Flash AS3 Helps: Catching XML Load Errors, Asynchronously

Not all errors in ActionScript 3 happen when you call a function. Some errors can occur sometime after the call. A common example of this is loading content from the web like XML or other content. Here is a sample of how to catch these types of errors

var myLoader:URLLoader = new URLLoader();
myLoader.addEventListener(IOErrorEvent.IO_ERROR, catchIOError);
function catchIOError(event:IOErrorEvent){
trace("Error caught: "+event.type);
}
myLoader.load(new URLRequest("Invalid XML URL"));
trace("Error, continuing...");
This will output:
Error, continuing...
Error caught: ioError