Variables in AS 3.0
A variable is a "container" represented by a name that holds information. That information can be later changed or retreived through the code using the variable-name.
Link to the basic page on variables, HERE
You need to declare a variable the first time you use it including word var, the name of the variable, the data type and initial value.
var |
myVariable | : | int | = | 8 | ; | |
var |
name | : | data type | = | initial value | ; |
The name of the variable should be one word, easy to remember and identify when debugging code. It should be written all lowercase, with no special characters.
To change the value: myVariable = (myVariable +1) also like that: myVariable+=1
To retreive the current value of the variable: trace (myVariable)