Share Posted October 17, 2017 Hey guys, seems like this should be basic and I'm missing something. I want to create a looping timeline, which can then be made a child of a main timeline. When main timeline is scrubbed the looping timeline in parallel with the main timeline. ie I have a 1 second loop. My main timeline goes goes for 3.5 seconds, but is paused so I can control it through scrubbing. I embed the loop in my paused main timeline. When I scrub the main timeline forward, the loop should have played 3.5 times (eg will end half way through), and pause. Do you remember the old days of flash, where you could create a looping animation, add it to another timeline and and set it to Graphic, which would allow you to see all looping elements in the same timeline/ scrub back and forth? That's what I want to do! Thanks See the Pen PJxKEz by spacewindow (@spacewindow) on CodePen Link to comment Share on other sites More sharing options...
Share Posted October 17, 2017 Hi @spacewindow When you add an infinitely repeating nested timeline to your master, your master will now infinitely repeat. If it were me, I'd leave the red ball timeline on its own and set its time based on the time of the master as you scrub it. Something like this: See the Pen gGQXbd by PointC (@PointC) on CodePen Does that help at all? Happy tweening. 2 Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2017 Wow that's a bit clever @PointC. Would not have thought of doing it that way, think that is going to work. If you don't hear from me again that solution has gone into production! Thanks for your prompt assistance. 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2017 (edited) @PointC I realised that I set up my example a bit incorrectly, sorry. It's actually the Timeline that is meant to repeat infinitely, whereas in my last example It was a single tween within a Timeline. I managed to do what you suggest, but had to add my ballRed timeline into another timeline (loops) then tweened loops.time() to achieve the same effect. This seems a bit complicated, even though I'm glad I got it working. I even added an extra timeline to the loops timeline and it all worked pretty well. Wonder if you, or anyone, can make a simpler example, or explain further. See the Pen MEzGwv by spacewindow (@spacewindow) on CodePen Edited October 17, 2017 by spacewindow Link to comment Share on other sites More sharing options...
Share Posted October 17, 2017 o.k. - if the timeline is repeating, we just need to change from setting the time() with the scrubber to setting totalTime(). That would then include repeats and delays whereas time() does not. Here's a fork of your pen in which I commented out the loops timeline and just used the repeating redBall timeline controlled with the scrubber and based on the time of mainTL. See the Pen BwGXYz by PointC (@PointC) on CodePen Does that help? Happy tweening. 2 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 25, 2017 Thanks again PointC. Nice. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now