So i went digging and i found in the base class of image, SWFLoader line 1497 the following
else if (byteArray) { loader = new FlexLoader(); child = loader; addChild(child); loader.contentLoaderInfo.addEventListener( Event.COMPLETE, contentLoaderInfo_completeEventHandler); loader.contentLoaderInfo.addEventListener( Event.INIT, contentLoaderInfo_initEventHandler); loader.contentLoaderInfo.addEventListener( Event.UNLOAD, contentLoaderInfo_unloadEventHandler); // if loaderContext null, it will use default, which is AppDomain // of child of Loader's context loader.loadBytes(byteArray, loaderContext); }
You see the problem? No listener or dispatcher for the IOErrorEvent! So i had to load my bytes using FlexLoader(); and listen for the events myself.














Same issue wanted to have an error when downloading a non supported image e.g. TIF. Came with the 2044 exception. Had to catch it with an event in the ContentLoaderInfo class
var loader:FlexLoader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, test);
loader.addEventListener(IOErrorEvent.IO_ERROR, handler);
loader.loadBytes(afbeelding);
imageHolder.source = loader.content;
this worked
Comment by Spiral — September 25, 2009 @ 1:22 pm