Skip to main content
Joe Sin
Participant
May 23, 2019
Question

Slider Control as Timecode Scrubbing

  • May 23, 2019
  • 1 reply
  • 352 views

Hey all.

I'm trying to link a slider control to mimic scrubbing through timecode ... but not the compositions timecode, basically I'm faking the specific "stops" where it stops at "1:34" and then moves around a bunch and stops at "5:41" etc.

I'm currently using the slider, but am not sure how to:

a) limit the 'seconds' to 59 (right now they go all the way to 99)

b) limit the 'seconds' to two decimals (right now, if it's "1.30" it shows at "1.3" ... other expressions in this forum regarding that didn't work)

Any help would be appreciated. Thanks!

This topic has been closed for replies.

1 reply

Tomas B. aka Tom10
Inspiring
May 23, 2019

Hey Joe,

a) For clock, have a look at Dan's breakdown .Something like this should work:

t = Math.floor(yourSliderValue);

min = Math.floor((t%3600)/60);

sec = Math.floor(t%60)

b) Add .toFixed(2) to the numeric value in order to force zeroes to appear. (Number in the brackets - amount of decimals)