Pass Variables into Flash

Okay, I just posted on how to Pass Variables into Flash by using a GET string approach, but there is better way. Using FlashVars to pass in variables is super easy.

To use FlashVars, create another params tag with name=”FlashVars” and value=”querystring”. Also, add a FlashVars=”querystring” in the embed tag. The querystring should not have the ?.

Once you have added that to your html, the variables will be available on the _root MovieClip in your Flash Application.

For example, if your querystring was “dataFile=data.xml” then _root.dataFile would contain “data.xml”. Pretty simple.
While the GET approach still works, it won’t work if you are trying to put a Flash application into a WordPress page or post. If you would like to embed Flash into a WordPress use the Kimili Flash Embed plug-in for WordPress. It makes adding Flash to a post really easy.

1 thought on “Pass Variables into Flash”

  1. Wow sweet flash and Word Press. Now I only need ot know how to code using Flash. Do you have any suggestions for a good read on how to code in flash…?

Comments are closed.