00:00
00:00
View Profile gltovar
Awwww you love me, cuz you are looking at my profile. = ]

Age 38, Male

Flash/Flex Developer

DeVry Alumni

Playa del Rey, CA

Joined on 4/28/01

Level:
18
Exp Points:
3,320 / 3,600
Exp Rank:
16,231
Vote Power:
5.97 votes
Rank:
Police Officer
Global Rank:
15,024
Blams:
502
Saves:
143
B/P Bonus:
10%
Whistle:
Bronze
Trophies:
5
Medals:
2
Gear:
2

Actionscript 3 Loader Error Catching

Posted by gltovar - July 21st, 2007


So I've been playing around with the portal.

The biggest issue I have been having was when there was no custom portal icon. There would be a URL error thrown. After many google searches, I always ended up with error catching that worked with URLLoader imports. They didn't work for me.

As it turns out Loader imports (like picture and such) have a different way of posting errors:

var loader:Loader = new Loader();
configureListeners(loader.contentLoaderInfo);

private function configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(Event.INIT, initHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); // the one i needed
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(Event.UNLOAD, unLoadHandler);
}

And with this i fixed all bugs.

Thanks to every one that helped.


Comments

Thanks for posting. I was having this very trouble this morning, and this post came up in Google. The Loader class is kinda goofy that way isn't it.