Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

set duration to tween in loop

Guest
Apr 27, 2013 Apr 27, 2013

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

}

TOPICS
ActionScript
588
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2013 Apr 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 27, 2013 Apr 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2013 Apr 27, 2013
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines