Share Posted September 28, 2017 I have this tween that repeats infinitely: var sparkleblink = TweenMax.staggerTo(".confetti", .5, {ease:Linear.easeNone, opacity:.2, repeat:-1}, .01); but I want to stop this animation after a certain point. I have a TimelineLite() which calls a function after the last animation: var tothebox = new TimelineLite(); tothebox.to(".scrollnotif", .1, {opacity:0}) // ** other animations here** // .to(".scrollnotif", .1, {opacity:1, onComplete:killthis}); Then I have that function that's being called onComplete: function killthis(){ sparkleblink.kill(); } Not sure if I'm missing something or what. Advance thanks for whoever is going to help! Link to post Share on other sites
Share Posted September 28, 2017 TweenMax.staggerTo() returns an ARRAY of tweens, but it looks like you're treating it as if it's a timeline or a tween. In other words, you're calling kill() on an array. You could either loop through that array and kill() each tween, or you could just use a TimelineLite staggerTo() instead so that all those tweens are embedded in a timeline which can be killed, like: var sparkleblink = new TimelineLite(); sparkleblink.staggerTo(".confetti", .5, {ease:Linear.easeNone, opacity:.2, repeat:-1}, .01); ... //then later... sparkleblink.kill(); Does that help? 2 Link to post Share on other sites