About dot syntax and target paths
In ActionScript, you use a dot (
belong to an object or instance on the Stage. You also use the dot operator to identify the
target path to an instance (such as a movie clip), variable, function, or object.
A dot syntax expression begins with the name of the object or movie clip, followed by a dot,
and it ends with the element you want to specify. The following sections demonstrate how to
write dot syntax expressions.
To control a movie clip, loaded SWF file, or button, you must specify a target path. Target
paths are hierarchical addresses of movie clip instance names, variables, and objects in a SWF
file. In order to specify a target path for a movie clip or button, you must assign an instance
name to the movie clip or button. You name a movie clip instance by selecting the instance
and typing the instance name in the Property inspector. Or you can specify the instance name
with code if you create the instance using ActionScript. You can use the target path to assign
an action to a movie clip or to get or set the value of a variable or property.
For more information on assigning an instance name and using dot syntax to target an
instance, see the following topics:
"About using dot syntax to target an instance" on page
"About scope and targeting" on page 123
"Using the Target Path button" on page 124
"About slash syntax" on page 124
For more information on objects and properties, see
About using dot syntax to target an instance
To write ActionScript that controls an instance such as a movie clip or manipulates assets in a
loaded SWF file, you must specify its name and its address in code. This is called a target path.
To target (or address) objects in a SWF file, you use dot syntax (also called dot notation). For
example, you need to target a movie clip or button instance before you can apply an action to
it. Dot syntax helps you create a path to the instance you need to target. The path to the
instance that you target is sometimes called the target path.
A FLA file has a particular hierarchy. You can create instances on the Stage or you can use
ActionScript. You can even create instances that are inside other instances. Or you might have
instances that nest within several other instances. You can manipulate any instance as long as
you name it.
118
Syntax and Language Fundamentals
) operator (dot syntax) to access properties or methods that
.
118.
"Object data type" on page
78.
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?
Questions and answers