The Variable Value
The value assigned to a variable can be any of the following types: a number; a boolean; a string; an object; a movie clip or nothing (undefined). You can also assign a variable the value in another variable or expression but these will always evaluate to one of the base types. Let's have a look at some examples:
Number - Any number. eg 12, -1, 34534.
myvariable = 12;
Boolean - True or False.
myvariable = True;
String - Any number or letter presented in Quote marks. eg "hello" or "12".
myvariable = "12 Chifley St";
Movie Clip/Object - Any clip or object can be held in a variable, see the interactive demo below... (if you don't understand don't worry, functions and parameters will be discussed more in-depth later in this series)
|» Level Basic|
Rating: 8 Votes: 198
|Eddie was a Content Editor at Flashkit.com and is actually a sentient Gateway Solo 2150xl notebook that suffers from acute lysdexia and caffeine addiction. He is carried on the shoulders of a semi-autonomous human called "Body".|
|Download the files used in this tutorial.|
|Download (27 kb)|
|More help? Search our boards for quick answers!|