[thelist] Flash question - passing argument

Geoff Sheridan web2k2 at premonition.co.uk
Tue Oct 29 03:52:01 CST 2002


Hi Kevin

You can pass a variable like this:
Within the html, passing variables bush="evil" and gore="actuallywon"
to the movie "Mymovie.swf":
<object >
<param name="movie" value="Mymovie.swf?bush=evil&gore=actuallywon">
<embed src="Mymovie.swf?bush=evil&gore=actuallywon">
</object>

Obviously you still need all that codebase and pluginspage gumph, (I
have ommitted it for clarity) but within the movie :
(_level0.bush=="evil" && _level0.gore=="actuallywon") == true;

Now if you want to pass a variable you don't know in advance, you
have to write it into the HTML dynamically with something like PHP.

Call the page with a link like this: <a
href="moviepage.php?bush=evil&gore=actuallywon">Election results</a>
Or from within a Flash movie like this (the variable already exist):
getURL("moviepage.php", "_self", "GET");
or roll your own:
Movieurl = "moviepage.php?bush=" add _level0.bush add "&gore=" add
_level0.gore;
getURL("Movieurl", "_self");

Then on the PHP enabled HTML page:
<object >
<param name="movie" value="Mymovie.swf?bush=<?= $bush >&gore=<?= $gore ?>">
<embed src="Mymovie.swf?bush=<?= $bush >&gore=<?= $gore ?>">
</object>

Note that <?= $bush ?> will simply print:
evil

Clear?  HTH

Geoff

"Little bit of politics creeping in there" - Ben Elton when he was left wing.



More information about the thelist mailing list