ggalan Posted April 14, 2010 Share Posted April 14, 2010 i have a looping set of instructions using onComplete. how could i kill this once startIt has been instantiated? stop(); import com.greensock.*; import com.greensock.easing.*; OverwriteManager.init(OverwriteManager.AUTO); function nextSquare4(){TweenLite.to(square, 1, {x:722, onComplete:nextSquare1, overwrite:false});} function nextSquare3(){TweenLite.to(square, 1, {y:59, onComplete:nextSquare4, overwrite:false});} function nextSquare2(){TweenLite.to(square, 1, {x:163, onComplete:nextSquare3, overwrite:false});} function nextSquare1(){TweenLite.to(square, 1, {y:305, onComplete:nextSquare2, overwrite:false});} function startIt() { delete nextSquare1(); delete nextSquare2(); delete nextSquare3(); delete nextSquare4(); square.x = 163; square:y = 59; TweenLite.to(square, 1, {x:722, overwrite:true, onComplete:nextSquare1}); } Link to comment Share on other sites More sharing options...
GreenSock Posted April 14, 2010 Share Posted April 14, 2010 You really need to look into using TimelineLite or TimelineMax. It will make this MUCH easier. And you can pause() or kill() the TimelineLite/Max instance anytime (or reverse() or play() or restart(), etc.). A TimelineLite or TimelineMax instance is like a container for TweenLite and/or TweenMax tweens (or even other timelines). Watch the basics video at http://www.greensock.com/timeline-basics/ The ASDocs are at http://www.greensock.com/as/docs/tween/ ... nemax.html The main page for TimelineMax is at http://www.greensock.com/timelinemax/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now