why is my loader not throwing an Event.COMPLETE when loaded?
hi all,
I've got a loader that I put an event listener on for Event.COMPLETE. I then add it as child of the stage and call the load method. The swf it's loading appears on the stage, but the Event.COMPLETE listener is never called. I can attach a MouseEvent.CLICK event to the loader and that works just fine. Am I doing something wrong? Any help is greatly appreciated!
package {
import flash.display.MovieClip;
import flash.net.URLRequest;
import flash.events.*;
import flash.display.Loader;
public class LoadBig extends MovieClip{
private var thing:Loader;
public function LoadBig() { // CONSTRUCTOR
thing = new Loader();
thing.addEventListener(Event.COMPLETE, thing_loaded);
thing.addEventListener(MouseEvent.CLICK, thing_clicked);
thing.load(new URLRequest('big.swf'));
addChild(big_thing);
}
private function thing_clicked(e:MouseEvent):void{ // THIS FUNCTION WORKS FINE
trace('thing was clicked.');
}
private function thing_loaded(e:Event):void{ // THIS FUNCTION IS NEVER CALLED?!
trace('thing is loaded.');
}
}
}