facebook graphapi
/**
* Copyright Glidias ( http://wonderfl.net/user/Glidias )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2CmH
*/
package {
import flash.system.LoaderContext;
import flash.net.*;
import flash.display.*;
import flash.display.Sprite;
import flash.events.Event;
import com.adobe.serialization.json.JSONDecoder;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
var loadUser:URLLoader = new URLLoader();
loadUser.addEventListener(Event.COMPLETE, onUserLoaded)
loadUser.load( new URLRequest("http://graph.facebook.com/btaylor/&type=normal") );
}
private function onUserLoaded(e:Event):void {
var decode:JSONDecoder = new JSONDecoder(e.target.data);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
var context:LoaderContext = new LoaderContext(true);
loader.load(new URLRequest(decode.getValue().picture), context);
}
private function onLoadComplete(e:Event):void {
addChild( e.target.content);
}
}
}