Jump to content
Search Community

How stop a TweenMax looped with "yoyo" paramater

Kittisak test
Moderator Tag

Recommended Posts

Hi all,

 

Thanks for this wonderfull class.

 

However, I cannot find the solution of my problem.

 

In a playlist, I use a TweenMax with "yoyo" paramater on "true", to make the track name blink while playing :

 

tabTrack[ct].alpha = 1;
TweenMax.to(tabTrack[ct], .3, {alpha:.2, repeat:-1, yoyo:true});

 

I would like the track name to stop blinking when playing is over. But I cannot figure out how to remove or transform a Tween that has been launched to make it blink.

 

Thanks for your help :)

Link to comment
Share on other sites

create a reference to your tween:

 

var blinkTween:TweenMax = TweenMax.to(tabTrack[ct], .3, {alpha:.2, repeat:-1, yoyo:true});

 

 

and then when you want it to stop do:

 

blinkTween.pause();

 

and you can also send your tween to a particular time

 

blinkTween.currentTime = .6

Link to comment
Share on other sites

And by the way, if you want to kill all the tweens of a particular object, you can simply use the TweenLite.killTweensOf() method. Like:

 

TweenLite.killTweensOf(tabTrack[ct]);

 

Carl's solution gives you the most control, though, because you can isolate just a particular tween (in case you don't want to kill the other tweens of the same target).

Link to comment
Share on other sites

  • 5 years later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...