PDA

View Full Version : Reading URL Querystring


amymeyers
07-16-2004, 01:24 AM
Please help me :)

I have been working on this issue for an embarrassing amount of time.

I am trying to figure out how to get flash to read parameters that are passed through a url as a query string.

For example, I may send an email to a client with a link such as:
<a href="http://www.yourdomian.com?id=20034"> so that they can view a particular product on my flash website.

When the user clicks the link, the url is correctly displaying the querystring above. But, I cannot get the flash file to get the parameter.

What code do I need to put into flash in order to be able to capture the id=20034 ?

Please save me :)

Billy T
07-16-2004, 01:57 AM
use php or something to get it out of the query string and insert it into FLASHVARS

a quick search will find you the details

cheers

amymeyers
07-16-2004, 02:05 AM
Thank you so much for your quick reply...

I have seen a lot of posts that say that flash automatically creates variables consistent with what is passed in the query string. I have been able to successfully test that the variable has been passed using LoadVars.

My problem is that I am having trouble with the syntax to use to get the value of the passed variables. Can you provide any sample actionscript?

Thanks again!

Billy T
07-16-2004, 02:51 AM
hmm I'm not sure what you mean

in your example you mentioned emailing a client with a link that contained a variable...to get that variable into flash you need to use the method I mentioned above

flash will automatically create the variables if they are included in the embed code

<param name="movie" value="somefile.swf?somevar=cool">

but that's not what you are wanting...

oldnewbie
07-16-2004, 03:10 AM
Maybe...
http://www.macromedia.com/support/flash/ts/documents/set_variables.htm#javascript :confused:

amymeyers
07-16-2004, 03:42 AM
It seems that I have made a mess of this site :)

My product catalog is set up in flash. So, I am unable to email a particular product to clients. Instead, I am only able to direct them to the home page. Now, I would like to change that so that I can pass a product id into the flash file to direct clients to individual products.

Do you have any suggestions on how to accomplish that?

Thanks so much for your help.