404 IOErrorEvent in BitmapData

I’m attempting to run a script that draws in JPGs and manipulates them on the fly but I’d also like to drop in a default image if one of the original images is not found (from an xml feed)

got the bitmapdata working and have an IOErrorEvent event set up to recognise the 404 error but cannot seem to close the circle. Here is the code so far. I think my logic is good but am getting ‘null object errors’ when the script runs.

script as follows -

private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
var eloader:Loader = new Loader();
var urlRequest:URLRequest = new URLRequest();
eloader.contentLoaderInfo.addEventListener(Event.CO MPLETE,onComplete);
urlRequest.url = ‘default_image.jpg’;
eloader.load(urlRequest);

}

private function loadImage(_img:String):void{
var loader:Loader = new Loader();

var urlRequest:URLRequest = new URLRequest();
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE,onComplete);
loader.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR, ioErrorHandler);
urlRequest.url = _img;
loader.load(urlRequest);

}

public function onComplete(event:Event):void{

setImageLoaded(String(event.target.url))
createBitmap(event);
var e:CustomEvent = new CustomEvent(CustomEvent.COMPLETE);
e.data = (event as Object);
dispatchEvent(e);

};

onComplete is the normal path to processing the image - and other functions take care of business beyond that so i’ve tried to intercept a file not found within ‘ioErrorHandler’ and replicate the actions of onComplete but no dice.

the error seems to be with setImageLoaded processing the event - setImageLoaded(String(event.target.url)) - but I’ve tried every combination I can think of with no effect

any ideas? would be very appreciative.
[URL=“http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=665&threadid=1339559&ansmessid=4866633&ansuserid=404648&setanswer=y”]