Skip to content

Instantly share code, notes, and snippets.

@icodeforlove
Created September 20, 2010 02:29
Show Gist options
  • Save icodeforlove/587353 to your computer and use it in GitHub Desktop.
Save icodeforlove/587353 to your computer and use it in GitHub Desktop.
import flash.display.Loader;
import flash.display.LoaderInfo;
/*
* pull a var from the embed and return it, if there is no param matching the name
* return a default value
*/
function getEmbedParam(name:String, defaultValue:String):String
{
var parameters:Object = LoaderInfo(stage.loaderInfo).parameters;
if(parameters[name] != null && parameters[name] != "") {
return parameters[name];
} else {
return defaultValue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment