User Guide

10 Flash 4 ActionScript Primer
The setProperty() function lets you set a property of a movie clip instance, as shown in the
following example:
setProperty(cartoonArea, _x, 100);
The following example is equivalent to the previous example but uses dot syntax:
cartoonArea._x = 100;
You can also get or set movie clip properties from within a tellTarget() statement. The
following code is equivalent to the
setProperty() example shown previously:
tellTarget("/cartoonArea") {
_x = 100;
}
For more information about the tellTarget() function, see “Controlling other timelines
on page 10.
Controlling other timelines
To specify a path to a timeline, use slash syntax (/) combined with dots (..) to build the path
reference. You can also use
_levelN, _root, or _parent from Flash 5 notation to refer to,
respectively, a specific movie level, the applications root timeline, or the parent timeline.
For example, suppose you had a movie clip instance named
box on your SWF files main
timeline. The
box instance, in turn, contains another movie clip instance named cards. The
following examples target the movie clip
cards from the main timeline:
tellTarget("/box/cards")
tellTarget("_level0/box/cards")
The following example targets the main timeline from the movie clip cards:
tellTarget("../../cards")
tellTarget("_root")
The following example targets the parent movie clip cards:
tellTarget("../cards")
tellTarget("_parent/cards")