Try, Catch… Finally

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!");
}

Get a variable set in the HTML Embed tags

Sets variables in the class that are set in the embed tags of the HTML

import flash.display.LoaderInfo;

try{
    _someVarStr = LoaderInfo(this.root.loaderInfo).parameters.someEmbedVar;
} catch(e:Error) {
    //Handle if this isn't set
};