The following example shows how you can detect when a Flash/ActionScript 3.0 UILoader control has completed loading it’s contents by listening for the complete event (using the Event.COMPLETE constant).
Full code after the jump.
// ActionScript 3.0 /* Requires: * - UILoader control in Library */ import fl.containers.UILoader; var urlReq:URLRequest = new URLRequest(); urlReq.url = "http://helpexamples.com/flash/images/image1.jpg"; var uiLoader:UILoader = new UILoader(); uiLoader.addEventListener(Event.COMPLETE, uiLoader_complete); uiLoader.load(urlReq); uiLoader.move(10, 10); addChild(uiLoader); var tf:TextField; function uiLoader_complete(evt:Event):void { tf = new TextField(); tf.text = evt.type; addChild(tf) }
{ 0 comments… add one now }