currentTime confusion but almost there

(theron_hp) #1


I have an issue with measuring currentTimeInTimeline.

The Main Timeline is divided into three sections, with something else at the end. The first 3rd triggers timeline level1. The second level2 and the third, level3.

If you get to the end of the timeline, you are supposed to trigger level4. Not working!

The code looks like this:

   	if (hypeDocument.currentTimeInTimelineNamed('Main Timeline') <= 2.5) {
				hypeDocument.startTimelineNamed('level1', hypeDocument.kDirectionForward);
		else if ((hypeDocument.currentTimeInTimelineNamed('Main Timeline') >= 2.5) && (hypeDocument.currentTimeInTimelineNamed('Main Timeline') <= 4.5)){
				hypeDocument.startTimelineNamed('level2', hypeDocument.kDirectionForward);			}
		else if ((hypeDocument.currentTimeInTimelineNamed('Main Timeline') >= 4.5) && (hypeDocument.currentTimeInTimelineNamed('Main Timeline') <= 7.9)){
				hypeDocument.startTimelineNamed('level3', hypeDocument.kDirectionForward);			}
		else if (hypeDocument.currentTimeInTimelineNamed('Main Timeline') > 8) {
				hypeDocument.startTimelineNamed('level4', hypeDocument.kDirectionForward);

Please help?

H (20.2 KB)


It looks like you need to make your main timeline longer than 8 seconds, since you’re trying to find a moment in time ‘greater than 8’, or change that logic to

>= 8

(theron_hp) #3

Yip, nothing wrong with the code. It had to do with the timing on my timeline.

Time wasted. Lesson learned! Moving on.

Thanks @Daniel!