Game Development Reference
In-Depth Information
As you can see, it's very compact information, but it all relates very clearly to things you can see
happening on the stage when the animation plays.
After you create a Psaaj object, you can still access its properties anywhere in the class and change
them if you need to. For example, if you want to change the duration of the animation, you can
change it like this:
If you need to change the endpoint of the animation, you can change it like this:
To find out the name of the object that is being animated (nk^kp in this case), you can use this:
Being able to access and change all these properties means that you can change the animation after
you create it, change it while it's running, or access any of the Psaaj object's properties for use in
other parts of your program. This is the same as the way you can change properties of filter objects
that you looked at in the previous section.
Psaaj objects also contain many more properties that you can change and access. Table 10-3 lists
them and explains what they do.
Table 10-3. Additional Tween class properties
Tween property
What it does
The frames per second (fps) at which the animation takes place. This is the
same fps as the main movie's frame rate by default, but you can change it to
a higher or lower frame rate without affecting the frame rate of the rest of
the movie. This is really useful for games because you can set lower-priority
animations (such as background animations) to a lower frame rate. That might
give your game a performance boost because it means that there's more pro-
cessing power available to animate important foreground objects.
Returns pnqa or b]hoa, depending on whether the animation is currently
Set this to pnqa to make the animation loop infinitely. A value of b]hoa stops
the loop.
Tells you the current value of the property that is being animated. For
example, if you use the following line of code in an AJPAN[BN=IA event in
the current example program, it displays the t position of the nk^kp every
frame: pn]_a$[psaaj*lkoepekj%7
Allows you to get or set the current time that has elapsed since the animation
started. The value it uses is related to the `qn]pekj property.
Search Nedrilad ::

Custom Search