Subscribe to RSS
get email updates
home | about | pixDif AIR app | video tutorials
polyGeek.com

place your ad here

Web Premium



Get Qwest High Speed Internet



Reading FlashVars in Flex

October 14th, 2008 . by polygeek

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.

Post to Twitter Post to Delicious Post to Facebook Post to Reddit Post to StumbleUpon


similar posts

2 Responses to “Reading FlashVars in Flex”



[...] covers it. If you need to read flashvars in a Flex project then try this. Share and [...]

comment number 2 by: Nash

   Welcome back (Change)

Leave a Reply

comment feed RSS   subscribe to this comment thread

Recent Posts

   



polyGeek.com

© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
M2 Websites
Local Directory for Los Angeles, CA

Better Tag Cloud