After the initial tween finishes, the
0 pixels. The following snippet (edited for brevity) shows the function prototype for the
method:
continueTo()
function continueTo(finish:Number, duration:Number):Void {
/* omitted to save space. */
}
Only two arguments pass to the
the Tween constructor method, as the following snippet shows:
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
/* omitted to save space. */
}
The five parameters that aren't required by the
, and
begin
useSeconds
class. When you call the
type), and
useSeconds
method uses the
continueTo()
specifying a value for the
import mx.transitions.Tween;
import mx.transitions.easing.*;
var ball_tween:Object = new Tween(ball_mc, "_x", Regular.easeIn, 0, 300, 3,
true);
ball_tween.onMotionFinished = function() {
ball_tween.continueTo(0, 3);
};
This code moves the
seconds. After the animation finishes, the
calls the
continueTo()
(
) to proceed from its current position and animate for three seconds along the x-axis
ball_mc
to 0 pixels and to use the same easing method. You use the values specified in the call to the
Tween constructor method for any parameters that you don't define in the
method. If you don't specify a duration for the
you specify in the call to the Tween constructor.
Creating animations that run continuously
You can make an animation continue moving back and forth along the x-axis without
stopping. The Tween class accommodates this kind of animation with the aptly named
method. The
yoyo()
execute, and then it reverses the
as the following procedure demonstrates.
494
Animation, Filters, and Drawings
ball_mc
continueTo()
) use the arguments that you defined earlier in the call to the Tween
method, you assume that the
continueTo()
arguments are the same as in the earlier call to the Tween class. The
value from the call to the Tween class, instead of
finish
argument, as the following ActionScript shows:
begin
instance along the x-axis from 0 pixels to 300 pixels in three
ball_mc
method. The
continueTo()
method waits for the
yoyo()
and
begin
movie clip tweens back to its original position at
method, instead of the seven arguments for
method (
continueTo()
event handler is triggered and
onMotionFinished
method tells the target object
method, it uses the duration
continueTo()
onMotionFinished
parameters. The animation begins again,
finish
,
,
,
obj
prop
func
,
,
(easing
obj
prop
func
continueTo()
event handler to
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?