Flash 8 Documentation |
|||
| Components Language Reference > Tween class > Tween.onMotionFinished | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
tweenInstance.onMotionFinished = function() {// ...};
Event handler; invoked when the animation reaches the end of its duration. Handling this event allows your code to react at the point at which the tweened animation is finished.
In the following example, a tween is applied to the img1_mc movie clip. When the tween reaches the end of its animation, it invokes the onMotionFinished event handler which calls the Tween.yoyo()method. The tween is therefore able to complete its animation before the Tween.yoyo() method is called to reverse the animation. A movie clip instance named img1_mc is required on the Stage for this example:
import mx.transitions.Tween;
var myTween:Tween = new Tween(img1_mc, "_x", mx.transitions.easing.Elastic.easeOut,0, Stage.width-img1_mc._width, 3, true);
myTween.FPS = 30;
myTween.onMotionFinished = function() {
myTween.yoyo();
};
Version 8
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00004155.html
Comments
Fumio Nonaka said on Sep 23, 2005 at 6:09 PM : !lja said on Sep 28, 2005 at 5:18 AM :