Skip to main content
April 27, 2013
Question

set duration to tween in loop

  • April 27, 2013
  • 2 replies
  • 612 views

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();

}

This topic has been closed for replies.

2 replies

Participating Frequently
April 27, 2013

I would just create a timer for 5 seconds and start it in the onFinish function.

Ned Murphy
Legend
April 27, 2013

Your question is not clear to me. You set the duration of the Tween in the arguments - in your case the 0.1 value

April 27, 2013

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