Sunday, August 19, 2007

Variables

In as 3, you have to tell flash what you're going to put into a variable. For example:

var userName:String = "Nate";
var userAge:Number = 25;
var myArray:Array = ["a","b","c","d"];
var theToggle:Boolean = true;
var whatever:*; //You can pass anything into that variable

You also HAVE to put the "var" on there. That wasn't required before, but now it is.

No comments: