public class Main extends Sprite { private var loader:Loader; // The asset loader private var progressOutput:TextField; // The text field in which // to display load progress public function Main () { createLoader(); createProgressIndicator(); load(new URLRequest("sunset.jpg")); }
private function createLoader ( ):void { loader = new Loader( ); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListener); loader.contentLoaderInfo.addEventListener(Event.INIT, initListener); }