1

I'm running an animation on a main timeline. It consists of many individual runners.

I need to be able to display a progress scrubber, and I'd ideally like to drive this from the animation event handler. However, the timeline doesn't seem to have the concept of progress at anything lower than the runner level. I tried using tl.on('time'...), but it is only triggered when transitioning between runners.

I could set up something to poll the timeline every so many ms and ask for the time(), but that seems kind of hacky.

Am I missing an obvious way of getting a smooth notification of progress as a timeline runs?

Cheers

Dave

pragdave
  • 11
  • 1
  • The time event should give you an update on every step the timeline does. If you need the endtime of the timeline you can use `getEndOfTimeline()`. With both of these numbers you can calculate a progress. You can also have a look here as an example: https://codepen.io/fuzzyma/pen/wQbVed – Fuzzyma May 01 '20 at 11:30
  • I looked at that example, but decided it didn't address my issue because there were always runners active. The symptoms I see here is that I get no updates when there's a gap between runners in the timeline. However, I modified your example to have gaps and the scrubber successfully traversed the gap (in my code, it stops at the end of the first, and then jumps to the second when that runner starts). Clearly it's an issue at my end, though, so I'll keep digging. – pragdave May 01 '20 at 15:25

0 Answers0