Play timeline IF more than 1 second

(Rickard Ax) #1

I am trying to have a button play the timeline if the playhead is at 1 second or more. If not it should not play the timeline.
Is there a easy way to solve this?


(Mark Hunte) #2

You will need to use some Javascript.

if ( hypeDocument.currentTimeInTimelineNamed('Main Timeline') > 1){
	hypeDocument.startTimelineNamed('SecondTimeline', hypeDocument.kDirectionForward)
	} (15.8 KB)

(Rickard Ax) #3

That was a great solution, it works perfect!

Thanks a lot


How is it different from putting a keyframe on “Main Timeline” at the 1 sec position that starts “SecondTimeLine”?


I get the inference that the playhead might be set to different times by other means (e.g. custom scripts, Hype’s API, etc.) - not necessarily running in a linear fashion from “0” seconds.

Just a guess.