Jump to content
Search Community

Remove all tweens in a label

Choochoo test
Moderator Tag

Recommended Posts

Anybody know of fast code that will remove all tweens in a label

 

example:

 

Timeline.addLabel("first",0);

Timeline.append(some_tween);

Timeline.addLabel("second",Timeline.TotalDuration);

Timeline.append(some_tween2);

 

Best way to remove the some_tween2, as well as the "second" label name, so it just goes back to

 

Timeline.addLabel("first",0);

Timeline.append(some_tween);

 

in the timeline

Link to comment
Share on other sites

If you want to remove the tweens that have a start time on a specific label, you could do:

 

var time:Number = myTimeline.getLabelTime("label2");

var tweens:Array = myTimeline.getChildren(false, true, false, time);

var i:int = tweens.length;

while(i--) {

if (tweens.startTime == time) {

tweens.kill();

}

}

myTimeline.removeLabel("label2");

 

Just make sure you have the latest version of the classes because removeLabel() was recently added. http://blog.greensock.com/timelinelite/

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...