Jayesh
Jayesh

Reputation: 3951

Passing Variables

Can you please give me some leads into passing variables from a HTML(or)ASP.NET file to Flash Action Script 3 file.

Please Help.

Thanks

Upvotes: 1

Views: 177

Answers (1)

Landon Lunsford
Landon Lunsford

Reputation: 11

Here is an in-depth tutorial by Adobe on this subject.

To summarize, you have two options:

  1. Add FlashVars="myVariable=value" attribute to your <embed> tag which embeds your SWF
  2. Add <param name=FlashVars value="myVariable=value"/> to your <object> tag which embeds your SWF

After this you can access your "key" variable from the document class or any display object attached to the stage using:

var myVariable:String = LoaderInfo(this.root.loaderInfo).parameters.myVariable.toString();

Good luck coding : j

Upvotes: 1

Related Questions