Hi Firdosh,

the flash player loads things asynchronously.
This means, your try catch block is over before the error occurs.

Cheers,
Ralf.

On 2/13/07, Firdosh Tangri <[EMAIL PROTECTED]> wrote:

  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




--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35

Reply via email to