I could use some expert eyes on this. I am trying to figure out the best way to load a local image (teaseFail.png), if a web URL comes up empty.
I thought the IOError would fire the ioMarqErrorListener. But it doesn’t look that way.
So I know I’m doing it all wrong. What is the best/right way to do this?
function loadImagesForShow(webURL){
preLoader.start();
var urlRequest:URLRequest = new URLRequest(webURL);
marqLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onMarqProgressStatus);
marqLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioMarqErrorListener);
marqLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onMarqCompleteStatus);
marqLoader.load(urlRequest);
loadThumbs();
}
function ioMarqErrorListener(e:IOErrorEvent):void
{
trace("ERROR DETECTED:" + IOErrorEvent + ">>>>>>>");
var urlRequest:URLRequest = new URLRequest("images/teaseFail.png");
marqLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onMarqProgressStatus);
marqLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioMarqErrorListener);
marqLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onMarqCompleteStatus);
marqLoader.load(urlRequest);
}