| TRACE ACTIONS VARIABLES A variable is like a container for numbers or strings (text). Variables: a means for the program to store data, such as a number or a string of text. It’s like a box your put stuff in order to do things, carry things around, etc. You declare or initialize a variable and then assign a value to it. You only declare it once. However, you can change or assign a new value to it anytime. You let Flash know by using “var” then the name of the variable and its type separated by a colon. A single “=” assigns a value to it. Here we are creating and declaring the values (what they contain) of the following variables- Variables must not contain spaces or weird characters. var myFirst:String="hello world! Today I am"; trace(myFirst+" "+mySecond); // This prints to the output panel in runtime. Here are examples-
|