Play timeline IF more than 1 second


(Rickard Ax) #1

Hi
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?

Thanks
Rickard


(Mark Hunte) #2

You will need to use some Javascript.

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

timeline_test_time.hype.zip (15.8 KB)


(Rickard Ax) #3

YES!
That was a great solution, it works perfect!

Thanks a lot
Rickard


#4

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


#5

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.