flashVars
June 24th, 2007 . by polyGeek![]() |
Watch a video tutorial on how to integrate video.Maru with FlashVars for dynamic video interfaces. |
FlashVars is a way of passing data from the HTML host page into Flash via the <object><embed> tags. You can read more about FlashVars at the Adobe site.
You can use Flash vars in two ways with video.Maru.
- flvAddress=someString
- xmlIndex=someNumber
In the first case if you pass flvAddress=someValue to your SWF then that will replace whatever, if anything, is the target path in the videoWindow. This way you can create one video interface that can then load any video you wish without republishing your FLA.
If you haven’t used FlashVars before it’s common to use them in conjunction with server side scripting languages so that ultimately the data that you pass into Flash originated from a database.
The second case you can can use FlashVars to tell it which node in the XML to start playing on startup.
You can also use the two cases together so that you pass both the path to the XML file to load and which node to first start playing.
If you are using the HTML/JavaScript code generated by the Flash authoring tool to publish your SWFs then you would add a line such as the one below to tell your video.Maru video player to load the following FLV: http://polygeek.com/polyGeekTV/videos/water.flv
‘flashvars’, ‘flvAddress=http://polygeek.com/polyGeekTV/videos/water.flv’,
The full code would look something like the sample below.
If you would like to load an XML file and also point to a specific node of the XML at startup then your code would look something like this:
If you use SWFobject then your code would look something like this:
And as a last example. If you have a Wordpress blog and you use the Kimili plugin - like I do - to load SWFs then your code would look like this:


