PDA

View Full Version : error handling



ghostmonk
October 1st, 2007, 10:27 AM
This seems rather bizarre to me. An error is being thrown on loader as follows.

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

So I added an eventListener to the Loader thusly, (and of course built the function to trace the error);

previewImageLoader.addEventListener(IOErrorEvent.I O_ERROR, ioErrorHandler);

However, my function is not being called. I've tried a few different error events, but they are simply not being handled. I am certain that this particular loader is the one throwing the error, as I have commented out the the load event, and the error stops.

Not sure what to do. This particular error is a little sparse on the web. If anyone has a resource, knows what the issue is, or would just like me to explain further, I would appreciate the dialogue.

netox
October 17th, 2007, 12:18 PM
This seems rather bizarre to me. An error is being thrown on loader as follows.

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

So I added an eventListener to the Loader thusly, (and of course built the function to trace the error);

previewImageLoader.addEventListener(IOErrorEvent.I O_ERROR, ioErrorHandler);

However, my function is not being called. I've tried a few different error events, but they are simply not being handled. I am certain that this particular loader is the one throwing the error, as I have commented out the the load event, and the error stops.

Not sure what to do. This particular error is a little sparse on the web. If anyone has a resource, knows what the issue is, or would just like me to explain further, I would appreciate the dialogue.

You have to add the event listener to the loader's contentLoaderInfo. Like so:
previewImageLoader.contentLoaderInfo.addEventListe ner(IOErrorEvent.IO_ERROR, ioErrorHandler);

mironcaius
August 11th, 2008, 07:09 PM
You have to add the event listener to the loader's contentLoaderInfo. Like so:
previewImageLoader.contentLoaderInfo.addEventListe ner(IOErrorEvent.IO_ERROR, ioErrorHandler);

I have the same problem and tried everything possible.

So the code i simple


var imgL:Loader=new Loader();

//loaders.contentLoaderInfo.addEventListener(Event.C OMPLETE, allLoaded);
imgL.contentLoaderInfo.addEventListener(Event.COMP LETE, allLoaded);
// Load in the image
imgL.contentLoaderInfo.addEventListener ( IOErrorEvent.IO_ERROR, handleIOError );
imgL.load(new URLRequest("Hero1.jpg"));

and added the listener. But why does this error apear in the first time ?

Thanks