Skip to content

Instantly share code, notes, and snippets.

@eiszfuchs
Created June 22, 2010 08:41
Show Gist options
  • Save eiszfuchs/448186 to your computer and use it in GitHub Desktop.
Save eiszfuchs/448186 to your computer and use it in GitHub Desktop.
// wtf.php
<?php
$data = array(
'home' => array(
'foo' => "d'oh!",
'bar' => '3',
'biz' => '2'
),
'some' => 'foobar'
);
echo "&json=".urlencode(json_encode($data))."&";
?>
// ActionScript 2
onSelfEvent (load) {
myJSON = new LoadVars();
myJSON.onLoad = function() {
trace(this.json);
};
myJSON.load("http://localhost/wtf.php");
trace("Loading ...");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment