Reputation: 50117
What is the preferred way of passing parameters to a Flex application deployed as a .swf
and how do I read the parameters from Flex?
I'm looking for the equivalent of passing and reading URL parameters in Flex land.
Upvotes: 1
Views: 317
Reputation: 39884
I like to use FlashVars.
var paramObj:Object = Application.application.parameters;
trace(paramObj['foo']);
Upvotes: 1
Reputation: 1606
public function getQuerystringProperty(property:String):String {
var bm:IBrowserManager = BrowserManager.getInstance();
var oArgs:Object = {};
bm.init("", "");
oArgs = mx.utils.URLUtil.stringToObject(bm.fragment, “&”);
if (oArgs[property])
return oArgs[property].toString();
return "";
}
Gets the QueryString from within Flex (no ExternalInterface).
Upvotes: 1
Reputation: 2938
embed the swf object in an html page and then use external interface. These articles should help you:
http://www.adobe.com/livedocs/flex/2/langref/flash/external/ExternalInterface.html
Upvotes: 0