Jump to content
Search Community

Pause Tweens that are delayed?

luxury test
Moderator Tag

Recommended Posts

Hi there!  So the issue that I'm running into is that I am trying to pause all of the tweens that are .isActive().  This works for all tweens that are actively tweening, but not those that have a delay on them.  They will then play while everything else if paused.  So what I'm looking for is a way to get .isActive() that includes delayed tweens.  Any help?

 

Some background:

Originally, I was using .pauseAll(true, true), and .resumeAll(true, true).  And that worked as expected, except I couldn't continue using that method because I can't resume all tweens because some will need to be resumed, and some will still need to remain paused.  So now I'm using getAllTweens(), and then storing off only the active ones using .isActive() and then using .pause() and .resume() on only those that are stored off.  Is there a way for .pause() to behave more like .pauseAll() or is there some other way that would work?  Thanks!

 

This is using TweenMax and as2.  I'm not using TimelineMax, nor can I for this project.

Link to comment
Share on other sites

If you're trying to pause everything, have you looked into TimelineLite.exportRoot()? That basically gathers up all the tweens that are currently on the root timeline and chucks them all into a TimelineLite wrapper that you can control however you want (pause(), resume(), timeScale(), whatever). 

var tl = TimelineLite.exportRoot();
tl.pause();

If you want to see if a tween/timeline is BEFORE its delay has expired, you could check like:

if (tween.timeline.time() < tween.startTime()) {
   //do stuff
}

Does that help? 

  • Like 1
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...