Reading FlashVars in Flex
To read the value of a FlashVar(s) use the following in your creationComplete handler.
_myNumber = Application.application.parameters.myNumber;
And the Javascript snippet would look like this if you using the default AC_FL_RunContent method.
"FlashVars", "myNumber=123",
Or for multiple variables:
"FlashVars", "myNumber=124&myString=polyGeek",
And if you’re using SWFObject then the Javascript would look something like this:
<script type="text/javascript">
var flashvars = {
myNumber: "123.456",
myString: "polyGeek" };
swfobject.embedSWF( '${application}.swf',
'${application}_div',
'${width}', '${height}',
'9.0.45',
'expressinstall.swf',
flashvars,
{bgcolor: '#ffffff', menu: 'false'}, {id: '${application}'});
</script>
More info about SWFObject at GoogleCode.
If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.






