deadlock32

Age/Gender: 24, Male
Location: Naperville, IL
Job: Game Dev at TY.com

Awwww you love me, cuz you are looking at my profile. = ]

Newgrounds Stats

Sign-Up Date:
4/28/01

Level: 18
Aura: Neutral

Rank: Police Officer
Blams: 502
Saves: 142
Rank #: 12,382

Whistle Status: Bronze

Exp. Points: 3,320 / 3,600
Exp. Rank #: 7,629
Voting Pow.: 5.97 votes

BBS Posts: 2,502 (0.79 per day)
Flash Reviews: 214
Music Reviews: 5
Trophies: 5
Stickers: 25

Entry #1

Newer Older

Jump to Entry: [ 1 | 2 | 3 | 4 | 5 | 6 ]


deadlock32

Actionscript 3 Loader Error Catching

Posted by deadlock32 Jul. 21, 2007 @ 9:54 PM EDT

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.

Log in to comment! | Share this!

The People Have Spoken

1 Comment

Jun. 9, 2008 | 12:02 PM GreenCastle says:

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.

Newer Older

Jump to Entry: [ 1 | 2 | 3 | 4 | 5 | 6 ]