Game Development Reference
In-Depth Information
Table 8-2. Methods and properties of Movie Clips animated on the timeline
What it does
Starts the animation.
Stops the animation.
ckpk=j`Lh]u$% Tells the object to move to a specific frame and then play from that point
forward. For example, ckpk=j`Lh]u$./%7 moves the timeline's playhead to
frame number 23 and starts playing from there. If you use frame labels in your
animation, you can insert the frame label name. For example, ckpk=j`Lh]u
$jatpOa_pekj%7 starts the animation playing from a frame labeled
ckpk=j`Opkl$% Stops the animation at a specific frame. ckpk=j`Opkl$./% stop the animation at
frame 23.
What it does
_qnnajpBn]ia Tells you the number of the frame where your animated object is.
pkp]hBn]iao Gives you a number that is the total number of frames of your animation.
To use these methods and properties with an animated object, you need to know where the object
is in its hierarchy of objects and subobjects. Let's say you want to control one of the enemy objects
directly inside @qjcakjKja. You can just add a line of code like this, and the enemy's animation will
If in this game you were using a document class (such as the I]ej*]o class you used in previous chap-
ters) and want to access ajaiuKja inside `qjcakjKja, you might use code that looks like this:
If you want to make an object's animation play and are programming directly inside that object's class,
you can use code that looks like this:
Timeline animation is often the best way to make your game objects move. Lucky for you, Flash hap-
pens to be great at doing animation. Have fun with this!
Search Nedrilad ::

Custom Search