Reputation: 455
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?
Upvotes: 4
Views: 23784
Reputation:
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.
Upvotes: 0
Reputation: 3143
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
Upvotes: 6