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:








I was told to come and check this tut out. I don’t know if this is going to help me.
This is what I wanna get done…
I have a page with links on it that should point to a certain movie to play. I would like to use one interface to have this happen.
I have the swf file already built out and sitting on my server as well as the xml file with the list of movies and their paths to the flv file. I also have the HTML file that got spit out when I published the swf.
Now I have made the proper changes to the HTML file that gets spit out along with the swf.
The problem that I am having is passing the playlist information from an external page within the server.
So what I have is the swf in one directory with the xml file and the html file that has the swf in it.
and in the root of the server i have another HTML file that has all the links that people can click on and hope to get that episode. Where I’m stuck on is getting the links in that external page to pass the choice of episode to the html file that has the swf sitting in it.
This is how i have those links now:
someText
Is that right can I do it like that?
Thanks,
Hey polygeek… I was hoping to get some help with this. I’ve done what was told on these tutorials but i’m just not getting the results that i thought i was going to get.
If there is anyway to get a sample of how you have your tutorial player set up that would be awesome. What you have set up is what i’m trying to do, and I think i’m missing something.
i have the player pointing to the XML file and then on my external page i have a link that calls for a pop up that displays the html page that contains the swf. it’s only playing the first movie in the XML file.
What does the syntax of the link on the external page need to contain?
Any thing would help.
Thanks,
Matt
@Matt, I’ll send you an email with the files for the video popup. Hopefully you’ll be able to reproduce that for your needs.
hi
i hav a flv player, inside a html page,
in html page one button is there,
that button should be invisible until user click & watch half of the flv movie(suppose it reach to a particular cue point),
after reaching particular cue point,that html button should be automatically active,
any idea how to do this type of thing using javascript in flash,plz provide the code for that
neeraj8585@gmail.com
@neeraj, yes, that’s very doable. Here’s the gist:
1-you come up with a method to trigger the event. using a cue point would work well
2-use the ExternalInterface to call a Javascript function in the HMTL container page
3-Javascript enables the button
Here’s a good ExternalInterface tutorial.