Grabbing PHP Variable

Hi,

What I am trying to do should be pretty simple, from what I’ve read…but I can’t figure out where I am going wrong.

Basically I want it so that a person is on a php, they click on a link (i.e. a thumbnail) and then are taken to a new page which has an swf embedded in it. This new page should pass a variable (for instance, the thumbnail id). I tried to do this by included the php variable in the ‘src’ tag whre I embed the swf, as I read that Flash will automatically detect that variable if I do.

This is what I have in the php file:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="test" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="test.swf?myVar=<?php echo $myVar; ?>" />
<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />  
 <embed src="test.swf?myVar=<?php echo $myVar; ?>" quality="high" bgcolor="#ffffff" width="550" height="400" name="test" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

At the top of that php file, I declare $myVar … for testing I just have $myVar=“bandit”;

And then in my swf, I just have a dynamic text box called myText (just for testing purposes), and have the actionscript:

_root.myText.text=myVar;

Anyone have any ideas where I am going wrong, or a better way to send a single php variable to Flash?

I appreciate all suggestions. Thanks!
-b.