User Guide
Terminology 27
Operators are terms that calculate a new value from one or more values. For example, the
addition (
+) operator adds two or more values together to produce a new value. The values that
operators manipulate are called operands.
Parameters (also called arguments) are placeholders that let you pass values to functions.
For example, the following
welcome() function uses two values it receives in the parameters
firstName and hobby:
function welcome(firstName:String, hobby:String):String {
var welcomeText:String = "Hello, " + firstName + ". I see you enjoy " + hobby
+".";
return welcomeText;
}
Packages
are directories that contain one or more class files and reside in a designated classpath
directory (see “Understanding the classpath” on page 268).
Properties are attributes that define an object. For example, length is a property of all arrays that
specifies the number of elements in the array.
Statements are language elements that perform or specify an action. For example, the return
statement returns a result as a value of the function in which it executes. The
if statement
evaluates a condition to determine the next action that should be taken. The
switch statement
creates a branching structure for ActionScript statements.
Target paths are hierarchical addresses of movie clip instance names, variables, and objects in a
SWF file. You name a movie clip instance in the movie clip Property inspector. (The main
Timeline always has the name
_root.) You can use a target path to direct an action at a movie clip
or to get or set the value of a variable or property. For example, the following statement is the
target path to the
volume property of the object named stereoControl:
stereoControl.volume
For more information on target paths, see “Using absolute and relative target paths” in Using
Flash.
Variables are identifiers that hold values of any data type. Variables can be created, changed, and
updated. The values they store can be retrieved for use in scripts. In the following example, the
identifiers on the left side of the equal signs are variables:
var x:Number = 5;
var name:String = "Lolo";
var c_color:Color = new Color(mcinstanceName);
For more information on variables, see “About variables” on page 44.