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.
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.
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
I like to use FlashVars.
var paramObj:Object = Application.application.parameters;
trace(paramObj['foo']);
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).