
I am famous, originally uploaded by yezzer.
I’ve just seen that they’ve changed my name to the correct spelling. Hurrah.
Although i’ve done a few AJAX’y things over the past year, i’ve yet to touch AJAJ.
After reading about Aral’s SWXFormat, I thought it would be a good idea to familiarise myself with JSON, so when it looked like i’d have to use some AJAX in my portfolio, I looked up a JSON example, and I must say i’m pleasantly surprised that using JSON with jQuery can be so simple.
Here’s the JSON:
[js]
{
“wintitle”: “Window Title”,
“url”: “http://domain.com”,
“height”: 415, “width”: 720
}
[/js]
And this is JS loading the JSON (using jQuery):
[js]
$.getJSON(”http://domain.com/script.php”,
{ field: “value” }, // send field value pairs
function(json){//return function
GB_showCenter(json.wintitle, json.url,json.height,json.width)
});
[/js]
How simple is that! All that time i spent parsing XML in javascript is over, yey!
As soon as i have a spare minute i’m going to create some swxformat tests – looks like it could be an even easier way to get data into flash!
A global day-long photo project. Take photos of your day and stick them on Flickr.
I’ll definitely be taking part, and i’d have thought there might be a fair few brightonians taking part too.
Check out the Flickr blog and group for more info.

Fritz, originally uploaded by yezzer.
Lucky man’s off to Taiwan!
I was taking a look at ThickBox earlier, and having a nose around calling it from Flash. To do this, I needed to call JavaScript from flash.
Although if you’re using Flash 8, you should probably use ExternalInterface, the quickest way to do this is by calling:
[as]
getURL(”javascript:functionName(param1,param2)”)
[/as]
It’s been a while since i’ve needed to to do this, and it just wasn’t working on a simple test. Even simplifying this wouldn’t work in either Firefox or IE:
[as]
getURL(”javascript:alert(’hi’)”)
[/as]
Turns out it works fine when the content is served through a webserver.
Also, after reading one of Mike Chambers posts, I found you can run this locally, if you put this in your object and embed tags:
[html]
allowScriptAccess=”always”
name=”allowScriptAccess” value=”always”
[/html]
Of course, this has other implications, so best not to do this unless you know what you’re doing.
Latest Comments