Jump to content
CrisCaducoy

Reset and and stop All Tweens (TweenMax and TimelineMax)

Recommended Posts

Is there any way for all the timeline/tweens to reset back to starting position all at once and pause them there and wait until triggered to play/resume again except the currently triggered timeline?

for example, I have 2 slides which identifies element if it was currently on the viewport and then fires the tween sequence inside a timelineMax. (don't mind the viewport identification as it was already done)

 

I tried 

TweenMax.killAll(false, true, false);

but what it did was, it pauses all the delayed and remaining tweens which leaves the current state of element. What I want is since these elements are came from autoAlpha:0, it will be set back to their starting timeline sequence and wait until being triggered again. That means when another timeline is triggered, it will abort all remaining tweens of the previous timeline and vise versa for both slides. 

The killAll scenario is, I can see the elements that are stopped and I don't want that. I want them to have all fresh entry everytime the sequence is triggered.

 

 

I am sorry for this issue has been solved years ago. Sorry for opening same thread.

Share this post


Link to post
Share on other sites

hello and welcome to the forums

 

have you tried after using the kill methods to clearProps? ... go to the below link and scroll down to clearProps to read about it:

 

http://api.greensock.com/js/com/greensock/plugins/CSSPlugin.html

also maybe something like this:

var targetElement = document.getElementById("targetElement");
TweenMax.killAll(false,true,fasle);
TweenMax.set(targetElement, {clearProps:"all"}); // or you can use "autoAlpha" as the value for clearProps

Share this post


Link to post
Share on other sites

Hi,

 

I'm not 100% clear on what you need to accomplish, but have you looked into TimelineLite's exportRoot() method?

 

In short it allows you to grab all loose tweens and timelines and place them in a new TimelineLite that you can then reverse() or set progress(0);

Share this post


Link to post
Share on other sites

Hey Carl.. when you use the exportRoot() method.. when using and exporting into another timeline,  are the initial values reset to when the timeline was first created? thx

Share this post


Link to post
Share on other sites

Thank you for the very fast and very informative replies there folks. I am sorry if I am that too lazy on reading docs or related topics. I tried searching some time but it returns to be not the one I want. I had accomplished what I want with this code:
 

myElementTL.pause(0);
myElementTL.clear();

and then trigger it again to make it restart if my condition triggers its restart with this:
 

myElementTL.restart();

...Anyway, thank you for all the replies. I will try and reconfigure what I did if the above of your solutions are better. Thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.