ktewes
(Kalle)
July 6, 2020, 3:13pm
1
I know, this must have been asked before - only, I can´t find an answer…
I want to jump to a specific time in an timeline via javascript. Let´s say 00:02,07. Means: goto second 2 + 7 frames - right? Now I can´t say something like:
hypeDocument.goToTimeInTimelineNamed(0:02,07, 'graph');
but
hypeDocument.goToTimeInTimelineNamed(2.24, 'graph');
I got the 2.24 more or less by trial and error but what´s the rule behind it?
Thanks in advance, Kalle
h_classen
(Hans-Gerd Claßen)
July 6, 2020, 3:26pm
2
30 Frames equals 1 second …
there’s been some efford on this in the extensionsection … if i remember it right
2 Likes
ktewes
(Kalle)
July 6, 2020, 3:34pm
3
Yes, I know. about the frames and second relation… Ok, would be 7/30 -> 0,233333
1 Like
MaxZieb
(Loves Hype)
July 7, 2020, 3:44pm
4
↑ extension index
hypeDocument.goToTimeIndexInTimelineNamed
Jump to timeIndex as seen in the Hype frontend.
/**
* hypeDocument.goToTimeIndexInTimelineNamed 1.0
* @param {String, Object, Number} timeIndex as seen in Hype GUI
* @param {String} time line to adress
* @param {Boolean} convert overbound values
*/
hypeDocument.goToTimeIndexInTimelineNamed = function (timeIndex, timelineName, convert) {
this.goToTimeInTimelineNamed( this.timeIndexToSeconds(timeIndex, convert), timelineName);
}
…
The function has multiple “interface” like string, object and number. You can leave them all in there or delete the ones you’ll never use from the help function.
1 Like
ktewes
(Kalle)
July 7, 2020, 5:28pm
5
Ok, always ask Dr. Zieb… Anyway, works for me by just calculating …
1 Like
MaxZieb
(Loves Hype)
July 7, 2020, 6:02pm
6
Yes, it’s only a helper that does a string to number calculation (and other interfaces). All boils down to the same formula in the end:
minutes*60 + seconds + frames/30
3 Likes