views:

796

answers:

2
urlRequest = new URLRequest(AccordionEffectPanel.EFFECT_DIR + fileName);

//initialize loader
loader = new Loader();

//wire image loading complete
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadEffectCompleted);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

//load image
loader.load(urlRequest);

This is the code piece I am getting error : Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. However, the code is supposed to handle this error silently since I wire IOErrorEvent

If this is not the appropriate way to handle IOError, how to handle IOErrors?

+2  A: 

For some reason Adobe decided that the Loader object would not dispatch events itself, instead you have to listen on the Loader.contentLoaderInfo property.

You can read more here: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#contentLoaderInfo

Lillemanden
It really worked, It is also how they implemented in their documentation of Loader class. I missed.
Oki
Please accept my answer if it helped you, thanks.
Lillemanden
Thank you.
Lillemanden
A: 

I had this problem, and apparently, "This example requires that you place a file named Image.gif in the same directory as the compiled SWF file". I got my script to work once I complied with this requirement.

mango