DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

AS3 FlashVars Equivalent: LoaderInfo

02.13.2008
| 25893 views |
  • submit to reddit
        // Add this to your package..
import flash.text.*;

// And throw this in wherever..
var t:TextField = new TextField();
t.autoSize = TextFieldAutoSize.LEFT;
t.border = true;
addChild(t);

t.appendText("params:" + "\n");
try {
	var key:String;
	var val:String;
	var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
	for (key in flashvars) {
		val = String(flashvars[key]);
		t.appendText("\t" + key + ":\t" + val + "\n");
	}
} catch (error:Error) {
	t.appendText(error);
}