Loader class not firing Event.COMPLETE
I'm having a problem that's got me stuck in AS3. I have this seemingly simple code:
PHP Code:
var loader:Loader = new Loader();
loader.addEventListener(Event.COMPLETE, function(event:Event):void{
trace('hi');
});
loader.load(new URLRequest('photo.jpg'));
The event.complete is never firing. Nothing I do works. If I make it a URLLoader and not a regular Loader it goes through fine and the event is fired, however this is an image I need to add to the stage so I need to use a Loader. But I can't figure out for the life of me why the event.complete isn't firing. I know it's loading because I can add the loader to the stage and the image shows up. Doesn't matter if I do local images or images from a server. What's going on here?