Flash + query string

Marketcake

God of Leisure
Dec 6, 2009
450
8
0
Paradise
is it possible for me to take a query in the URL and import it into an swf, without using external javascript files or any editing of code on the html page itself.

Just an swf that can display in it a query from the URL?

Thanks
 


You have a page that your Flash is going to display on but you can't edit that page, and you want your Flash to grab variables from the query string of the page's URL?

You would have to put some script on that page to pull the variables and plug them in to the query string of your actual Flash file's URL. (Then you can access those values from within the Flash app.)
 
try this:

Code:
example.swf?foo=bar

then in fla source:

Code:
trace(_root.foo);
 
You can do this multiple ways.
1) JavaScript
2) Houdas's method (Above)
3) FlashVars
Code:
Via Param:
<param name="flashvars" value="WickedFire=Awesome&Bitches=LoveMe" \>

Via Attribute:
<embed
 src="movie.swf"
 flashvars="WickedFire=Awesome&Bitches=LoveMe"
 bgcolor="#FFFFFF"
 width="200" height="200"
 type="application/x-shockwave-flash">
</embed>

Good luck and test in multiple browsers.
 
How do I just 'echo' a variable or something in flash. action scripting is a language i have never learned..

i just want to display it in a text area. so far I have put the action script above into frame 1, although im not sure how to print it once its traced
 
nevermind, i might need to check on some things before i do this... this might be really pushing what is allowed lol