Because the error did not occur during the call to load, but in servicing the load request asynchronously at a later time. You may have noticed that there was no call stack in the error. So, you have to be aware of when things are not performed immediately. -Alex
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Firdosh Tangri Sent: Monday, February 12, 2007 3:18 PM To: [email protected] Subject: [flexcomponents] Error Handling Question 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
