How to run Waypoint animation once in 3.5

On the waypoint action: set it to run a new function. In the function do something like:

if (! window.displayed){ //-- if false

hypeDocument.startTimelineNamed('timelineName', hypeDocument.kDirectionForward)
 window.displayed = true;
 }

window.displayed is a global var, so it will stick around in the session memory of the window.
Because we did not define it before we check if it exists with the not exists statement ! window.displayed it will be undefined which is what this check will return. In this case that is equivalent to false.

We then run the code. and then set window.displayed to true. That defines it and on subsequent checks it will exist and be true so the code will not run.

1 Like