
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
984
|
Appendix C: Backward Compatibility and Player Build Updates
Controlling Movie Clips
In Chapter 13, we discussed how to control clips using Flash 5 (and later) tech-
niques. Here we consider the equivalent Flash 4 techniques.
Prior to Flash 5, we executed special Movie Clip Actions to control a movie clip. We
said, “Tell the clip named
eyes to play,” using the following:
Begin Tell Target ("eyes")
Play
End Tell Target
But as of Flash 5, movie clips can be controlled more directly, through built-in meth-
ods. For example:
eyes.play();
Similarly, to access the built-in properties of a movie clip prior to Flash 5, we used
explicit property-getting and property-setting commands, such as:
GetProperty ("ball", _width)
Set Property ("ball", X Scale) = 90
As of Flash 5, we can retrieve and set a movie clip’s properties using the dot opera-
tor, just as we access the properties of any object:
ball._width;
ball._xscale = 90;
Prior to Flash 5, to access variables inside a movie clip, we used a colon to separate
the clip name from the variable name:
Set Variable: "x" = myClip:myVariable
As of Flash 5, a variable in a movie clip is simply a property of that clip object, so we
use the dot operator to set and retrieve variable values:
x = myClip.myVariable;
Finally, prior to Flash 5, we accessed nested