Copy link to clipboard
Copied
how can i set duration to a tween to which i set loop using yoyo?
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var myTween = new Tween(sounds_click, "x", Elastic.easeInOut, 325,335, 0.1, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, onFinish);
function onFinish(e:TweenEvent):void {
myTween.yoyo();
}
Copy link to clipboard
Copied
Your question is not clear to me. You set the duration of the Tween in the arguments - in your case the 0.1 value
Copy link to clipboard
Copied
sorry you are right.
i want the motion to be 0.1 seconds but to be repeated 50 times (or 5 seconds)
by using the above i get endless loop
Copy link to clipboard
Copied
I would just create a timer for 5 seconds and start it in the onFinish function.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now