/ Published in: ActionScript 3
When you just need something small and simple.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
initLoad(); function initLoad() : void { var contentLoader : Loader = new Loader(); var s : Sprite = new Sprite(); var link : String = "http://isokon.net/post/cloudvcloud.jpg"; // here we are adding the child of what the utility returns s.addChild( load( link, contentLoader )); addChild(s); } // the loading utility function load( url:String, l:Loader ) : Loader { l.load( new URLRequest( url ) ); return l; }