1) Open the html or aspx file where you have flex swf file embedded.
2) You will see 2 AC_FL_RunContent sections
3) Look at the line in Red, I am passing the value Hello World to the swf file
AC_FL_RunContent(
"src", "FlashV",
"FlashVars", "MMredirectURL=Hello World",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "FlashV",
"quality", "high",
"bgcolor", "#869ca7",
"name", "FlashV",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
-------------------
Now in mxml file, on ApplicationComplete, call a function
applicationComplete="Init()"
private function Init():void
{
var o:Object = this.loaderInfo.parameters;
Alert.show(o.MMredirectURL.toString());
}
Few more ways to pass variable to flex
ReplyDeletehttp://yasob.blogspot.com/2009/05/accessing-http-request-parameter-in.html
http://yasob.blogspot.com/2009/05/accessing-http-request-parameter-in.html
ReplyDelete