Alan MacDougall wrote:

This looks completely straightforward and identical to Java... but when I do it, it catches the generic error. Now, obviously an Error instance is getting caught, which means one is getting thrown, which means my InvalidPathFormatException IS being recognized as a subclass of Error! It's just not getting caught by the right block! And it's not a priority thing, because if I omit the catch block for e:Error, I don't catch anything at all (but I DO get debug output of the string "Error").

One of the comments for the relevant Live Doc solved my problem: you have to use the entire qualified class name in your catch statement.

try
{
   stuff();
}
catch (e:com.mydomain.package.ExceptionClass)
{
   trace(e.message);
}

This chapter from Colin Moock's book ( http://www.actionscript.org/resources/articles/603/1/Exceptions-and-Exception-Handling/Page1.html ) appears to miss this vital piece of information... I guess he tested it on a version of Flash Player that didn't have that bug?

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to