Archive for April, 2008

Testing for FlashVars in AS2

Quick bit of code stick it on the first frame of new flash file and it will list all the FlashVars passed into the flash.

//creates the text feild on the stage

this.createTextField("vars_txt",3,100,100,Stage.width-100, Stage.height-100)

//sets the basic properties

vars_txt.multiline = true;

vars_txt.selectable = true;

//adds the title

vars_txt.text += "FlashVar : Contant of FlashVar\n";

for(var z in _root)

{

 //$version: version is on the root by default so it is excluded

 //vars_txt: is the name of the text field so it is also excluded from the list

 if(z !=  "$version" && z != "vars_txt")

 vars_txt.text += z + " : " + _root[z]+"\n";

}