Skip keyframe on timeline when first time playing


(Jeroen) #1

Hello,

I have a little knowledge of javascript (I’m more a designer) but I can’t figure it out with this script.

When the timeline will play for the first time it must skip (at 1 sec.) a keyframe on the timeline. I have this script on the keyframe in the timeline:

var checkABClicked = hypeDocument.getVariable(‘abClicked’);

if (checkABClicked) {
hypeDocument.pauseTimelineNamed('Main Timeline');
hypeDocument.setVariable('abClicked', false);
}

When the timeline is finished playing for the first time there will be a button. When you click on the button the Timeline will play in reverse and it need to pause at the keyframe who is skipped when it first played. I use the following script when I hit the button:

hypeDocument.setVariable(‘abClicked’, true);

Can someone give me the right script. Thanks!


(Jeroen) #2

I’m new to Hype so working with multiple timelines wasn’t my first option but it is the solution.