Would it be possible (either through javascript code, or as a future feature of HYPE) to have a button play to a time in the timeline, instead of go to time in timeline. The difference being that the scene will smoothly play from its current time code either forward or backwards to another timecode instead of the hard snap of the ‘Go to time in timeline’. This would be nice in carousels where you have buttons to jump to specific image in that carousel, instead of cycling through them with arrows.
In the examples code I have add a couple of if conditions that stop a button trying to play if the time line is gone past it's destination time. ( I will probably add that part to the extension itself )
var currentTime= hypeDocument.currentTimeInTimelineNamed('foo1')
var goFromTo_1 = 4
var goFromTo_2 = 8.10
console.log(currentTime)
if (element.id == "goFromTo1"){
if (currentTime < goFromTo_1){
hypeDocument.continueTimelineNamedFromTo("foo1", currentTime, {timeToSeconds:goFromTo_1 , kDirection: hypeDocument.kDirectionForward})
}
}