Loading vars straight from a url

i’m trying to read in the URL displayed in flash

if i do this:

url=this._url;

i get:

http://domain.com/myFlashMovie.swf

but i what i actually want is:

http://domain.com/myFlashMovie.htm

plus whatever i pass through the URL

e.g.

http://domain.com/myFlashMovie.htm?canUCme

help is appreciated
:slight_smile:

in case anybody needs to do this @ some point, i’ll share how i finally did it:

don’t sleep (you forget stuff)
drink coffee (keeps you awake)

=)

i did it using javascript, because it’s most browsers’ default language and i don’t have a php/mysql/asp etc enabled server (and if i did, i wouldn’t know how to use it)

====
1 place an input textbox on our main timeline (don’t place it inside a movieclip because it won’t work this way and i don’t know if you can send variables to a movieclip inside an swf, but if you can i imagine it’ll cost you another week’s sleep)

2 attach a variable to the input box (e.g. varInput)

and that’s it (no loadVars functions needed). save your file and insert it into an html document

3 add some javascript (file attached)

and upload
=)

you can then pass variables in the http header like this:

www.domain.com?varInput=hello
(varInput is the name of the input textbox in your swf)

===

NOTES: if you haven’t used javascript before (like me) it can be a nightmare to integrate. don’t miss anything out (all the ’ signs count --> i originally missed them thinking they were there for commenting purposes)

the function that works out the http variables from rest of the string and passes it to the swf is: document.location.search (if you have a javascript book handy i’m sure it’ll be documented there - or if you’re luckier than me you might find a useful tutotrial on the net)

good luck