Passing values in querystring of url...

I need to use variables passed in the query string of the page in my flash movie but am having a tough time implementing the code properly.  Is there no actionscript that allows you to have access to the query string directly?

It seems that you need to hard code values into the query string in most of the examples I have seen.  For instance they say you should do this:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  WIDTH="250" HEIGHT="300" id="movie">
  <PARAM NAME=movie VALUE="movie.swf?myvar=variable1">
  <PARAM NAME=quality VALUE=high>
  <EMBED src="movie.swf?myvar=variable1"
    quality=high bgcolor=#FFFFFF WIDTH="250" HEIGHT="250" NAME="flaMovie1"

But this seems like it is hardcoding what the query string values are.  So if you visit the webpage with this swf embedded in it with this value:

Than the movie wouldnt pick up the different value of myvar.  Or maybe I am missing something.  It also doesnt help that any time I change the movie and embed values in my object tab (ie from movie.swf to movie.swf?myvar=$value1) I get a security exception with flash player and it wont let me call the webservice from a different domain...
Who is Participating?
Fern2Connect With a Mentor Commented:
If you are using JSP, Coldfusion or some other serverside scriptiing then your can pass your URL parameters to the "flashvars" when the page is created.

If your are just using basic HTML, then you can use Javascript to pass the URL parameters to the "flashvars".
Use this:
<PARAM NAME=FlashVars VALUE="myvar=variable&myvar1=variable1&myvar2=variable2">

Then when the movie loads you can trace the variables.

outout: variable
outout: variable1
outout: variable2
wildbrookmediaAuthor Commented:
I think your first post makes it so that the parameters are always the same values.  (ie the flash movie doesnt really look at the query string for the variables)

I will have to look into javascript I think...
thats my point, you can set the "flashvars" with javascript.

wildbrookmediaAuthor Commented:
for those that browse this question later, the best javascript example I found was here:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.