i have a flash button and i want to pass the button link (after click) as parameter. what is the best way to do it?
+1
A:
You can pass parameters along to Flash using flashvars.
Suppose you want to pass the URL of the website to navigate to when the user clicks a button, you can add the following parameter to your Flash <OBJECT>
HTML tag:
<param name="url" value="http://www.helloworld.com" />
In ActionScript, you can read this flashvar using this piece of code:
var flashVars:Object = LoaderInfo(this.root.loaderInfo).parameters;
var url:String = "http://www.backupurl.com";
if (flashVars.url != undefined) {
url = flashVars.url;
}
(Source example borrowed from this blog article)
Prutswonder
2010-07-15 14:29:49
this is what i was looking for.how do i read it inside the flash?
junkqwe
2010-07-15 14:32:36
Updated my answer with some source code for you. :-)
Prutswonder
2010-07-16 06:37:33
A:
this is how it's done in AS3: root.loaderInfo.parameters[ "name of param you want to read" ];
__dominic
2010-07-15 14:35:47