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);
}
}
}
Related examples in the same category