Handling an event announcing a loaded object's availability : Loader : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » Loader »

 

Handling an event announcing a loaded object's availability


 
package {
  import flash.display.*;
  import flash.events.*;
  import flash.net.*;
  import flash.utils.*;

  public class Main extends Sprite {
    private var loader:Loader;

    public function Main(  ) {
      loader = new Loader(  );
      loader.contentLoaderInfo.addEventListener(Event.INIT,
                                                initListener);
      loader.load(new URLRequest("Module.swf"));
    }

    private function initListener (e:Event):void {
      loader.content.addEventListener("ASSETS_READY",
                                      assetsReadyListener);
    }

    private function assetsReadyListener (e:Event):void {
      trace(Object(loader.content).t.text);
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Network
» Loader