<< SLC Adobe User Group

Blog

Our Blog

Blog Home | About | Entries By Date | Search

Flashvars in AS3


Entry posted 02/05/09 by Dan.Smith last edited 02/05/09
867 views, 0 comments.

Title
Flashvars in AS3

Entry

Another new feature in AS3 ( actionscript 3 ) is the new method of calling and setting flashvars in your actionscript.  Back in actionscript 2, you just called them after setting them in your html code and magically they appeared.  AS3 is different.  While there are a few methods to do this, the simplest way I’ve found is this:

//the name of my flashvar is myVar

myText.text = root.loaderInfo.parameters.myVar;

Then you can use the Flash AS3 global variable method I use here to set your flashvar in as3 as a global variable.

MyGlobal.myString =  root.loaderInfo.parameters.myVar;