public class Main extends Sprite { private var loader:Loader;
public function Main() { loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, initListener); var urlRequest:URLRequest = new URLRequest("sunset.jpg"); loader.load(urlRequest); }
private function initListener (e:Event):void { addChild(loader.content); // Add Bitmap object to SunsetViewer } } }
Related Scripts with Example Source Code in same category :