|
-
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?
-
I don't know what is happening, but you should add a listener for ioerror, and try to catch SecurityErrors to find out.
-
Oh, figured it out. Didn't read the help files closely enough. It's
loader.contentLoaderInfo.addEventListener()
not
loader.addEventListener()
but thanks, you pointed me in the right direction
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|