Graphics Reference
In-Depth Information
chapter. Also like the other classes in this chapter, let
'
s take a quick
look at the variables in Table 12.5.
And now let
s move on to the functionality of ReverseClip by
first taking a look at its play method. The ReverseClip play method
calls for four parameters. Three of them are optional, one of them
is required, and all of them are listed in Table 12.6. But before we
look at these, what
'
s happening in the play method? The very first
thing that happens is that we check to see if _revTimer has a
TimerEvent listener attached to it. If it does, we know that
ReverseClip is in use and that all the variables already have values
assigned. In that case, we jump down to tell the _revTimer to start.
However, if it doesn
'
'
t have that TimerEvent listener attached to it,
that means it
s not being used and we need to assign some values
based on the parameters before we go any further. And don
'
t forget
that we also need to add that listener that will trigger the reverse
Frame method.
'
Table 12.5 The Variables of the ReverseClip Class
Variable
Purpose
REVERSE_COMPLETE (public, static String)
Passed via DataEvent to notify of reverse completion
_revTimer (private, static Timer)
Timer used to reverse the MovieClip
_targetClip (private, static MovieClip)
The MovieClip that will be reversed
_targetFrame (private, static int)
Frame at which the reverse will be complete
_loopCount (private, static int)
Number of times to allow the animation to loop
_currentLoop (private, static int)
The number of loops that have happened so far
Table 12.6 Parameters for the ReverseClip
Play Method
Parameter
Purpose
targetClip (MovieClip)
The MovieClip you want to reverse
loopCount (int)
The number of times you want your MovieClip to loop; default is 0 and ‒1 loops infinitely
targetFrame (int)
The frame where you want the MovieClip to stop playing in reverse; default is 1
speed (Number)
The number of milliseconds between the TimerEvents that tell the MovieClip to
reverse; default is 30
Search WWH ::




Custom Search