In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

facebook graphapi

Get Adobe Flash player
by Glidias 01 Mar 2011
    Embed
/**
 * 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);
        }

    }
}