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
or to get or set the value of a variable. For example, the following statement is the target path to
the variable
volume
_root.stereoControl.volume
For more information on target paths, see "Absolute and relative target paths" in Using Flash
Help.
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 = 5;
var name = "Lolo";
var c_color = new Color(mcinstanceName);
For more information on variables, see
Syntax
As with any language, ActionScript has syntax rules that you must follow in order to create scripts
that can compile and run correctly. This section describes the elements that comprise
ActionScript syntax.
Case sensitivity
In a case-sensitive programming language, variable names that differ only in case (
are considered different from each other. Therefore, it's good practice to follow consistent
capitalization conventions, such as those used in this manual, to make it easy to identify names of
functions and variables in ActionScript code.
When you publish files for Flash Player 7 or later, Flash implements case sensitivity whether you
are using ActionScript 1 or ActionScript 2.0. This means that keywords, class names, variables,
method names, and so on are all case sensitive. For example:
// In file targeting Flash Player 7
// and either ActionScript 1 or ActionScript 2.0
//
// Sets properties of two different objects
cat.hilite = true;
CAT.hilite = true;
// Creates three different variables
var myVar=10;
var myvar=10;
var mYvAr=10;
// Does not generate an error
var array = new Array();
var date = new Date();
This change also affects external variables loaded with
.) You can use a target path to direct an action at a movie clip
_root
inside the movie clip
stereoControl
"About variables" on page
:
40.
.
LoadVars.load()
and
)
book
Book
Syntax
29
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?