Hey I was playing around with error handling

I did a simple external xml load

var file:String=filePath +"vieweeer.xml";
var xmlURL:URLRequest=new URLRequest(file);
var xmlLoader:URLLoader=new URLLoader();

try{
  xmlLoader.load(xmlURL);


}
catch(err:IOError){
  trace(err.message);
}


But It didnt catch the error, i get the error box when I run the app but no
trace statement


But if I do

xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

it calls my errorHandler function

Can someone please explain why the first way doesnt work ??

thanks
cheers :)
firdosh

Reply via email to