Works on any timeline and is reusable!
If you need to create a directional pause this little timeline function should be helpful. Pretty simple and straightforward regular Hype Function (see screenshot):
Create a function and name it pauseIfPlayingForward and then copy & paste this code:
if ( hypeDocument.currentDirectionForTimelineNamed(event.timelineName) == hypeDocument.kDirectionForward) {
hypeDocument.pauseTimelineNamed(event.timelineName);
}
Example:
The following is only one example of what you could do with this technique. In this case we always continue a timeline if clicked but pause when playing forward with the little helper above:
Download Example:
HypeTimelinePauseIfPlayingForward.hype.zip (15,8 KB)
Hope this helps°
There is also a "bonus" function that works for the reverse case (literally). I mostly don't use the reversed version but if you would ever need it … here you go: Create a function and name it pauseIfPlayingReverse and then copy & paste this code:
if ( hypeDocument.currentDirectionForTimelineNamed(event.timelineName) == hypeDocument.kDirectionReverse) {
hypeDocument.pauseTimelineNamed(event.timelineName);
}