Jump to content
RolandSoos

What is the right way to merge multiple parallel timeline into one

Recommended Posts

For example I have 2 timelines and both contains several tweens. These two timelines are placed to a main timeline both of them to position 0.

See the Pen QzVYyP?editors=0010 by mm00 (@mm00) on CodePen

 

If I would like to remove the two additional timelines, what would be the best way to place the tweens to the timeline. (Try to think in general with a lot of involved tweens.)

 

 

Getting the .recent() tween from the timeline and sum .startTime() and .totalDuration() of the tween is the right way to get the upcoming position of that tween?

 

See the Pen oJPmGp?editors=0010 by mm00 (@mm00) on CodePen

 

Share this post


Link to post
Share on other sites

You're trying to empty one timeline into another? Yeah, you could just getChildren() and loop through and add() them to the other. But it isn't as if it's expensive to have nested timelines, so don't feel like you NEED to do that to somehow avoid a performance problem. There are even some cases where having things nested could lead to improved performance (though I highly doubt it'd be noticeable).  

  • Like 2

Share this post


Link to post
Share on other sites

Thanks, if it does not improve performance, then I will stay with multiple nested timelines. 

 

(I had a misunderstanding with immediateRender and I thought the nested timelines cause the issue. I thought if I have multiple fromTo tweens on the same element and same properties in the same timeline, then I do not have to take care setting immediateRender to false when required. Well, it turned out I have to take care of it :) )

  • Like 1

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.