Jump to content
Search Community

kill()

ggalan test
Moderator Tag

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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