View Full Version : Is it possible to pass your swf an argument from HTML?
karma-lab
08-15-2005, 04:18 AM
Lets say you have a Flash video player, and it plays a number of external .flv files. Would there be any way to invoke the .swf video player via HTML, and pass it the argument of which video you want it to play first, so that you could call it from different web pages with different starting videos?
Something like http://mysite/myvideoplayer.swf&start=1
I would think there must be some way to do this? If not, some other technique to achieve the same sort of functionality?
Jiggie
08-15-2005, 06:39 AM
yes its possible.
heres how u do it.
in the object tag of your html that holds the swf add the ff to the movie parameter:
?mydata=<?=$id?>
so your movie parameter wud luk like dis:
<param name="movie" value="splash_menu.swf?mydata=<?=$id?>" />
dont forget to add thid too in the <embed src> tag.
now your url will be: http://www.mysite.php?id=asdf
*take note, i'm using php
Scottae
08-15-2005, 06:13 PM
Check out this link on Using FlashVars to pass variables to a SWF (http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16417)
karma-lab
08-15-2005, 07:32 PM
Excellent - thanks guys!
karma-lab
09-10-2005, 06:05 PM
yes its possible.
*take note, i'm using php
Hey Jiggie, I've been trying to make this work (a little bit delayed, I know).
I've done what you said, but I'm stuck on the .php part. What is in the .php file?
It doesn't seem to work trying it like this:
http://www.mysite.html?id=asdf
Jiggie
09-12-2005, 02:02 AM
Hi!
you shud use http://www.mysite.php?id=asdf
vBulletin v3.5, Copyright ©2000-2010, Jelsoft Enterprises Ltd.