Try, Catch… Finally
July 29, 2010 Leave a comment
Try is used around things that might blow up. Catch handles what happens if it does blow up and Finally handles what do after either happens (usually not used).
try { //some Code that might blow up (IO Errors, Regular Errors, etc); } catch(error:IOErrorEvent) { trace("IOErrorEvent catch: " + error); } catch(error:Error) { trace("Error catch: " + error); } finally { trace("Finally!"); }