On Any Timeline Complete Action

In Hype 3 we removed the On Any Timeline Complete Action in favor of using Timeline Actions. We found this action was causing some confusion and it is generally better to specify which timeline you want to run the action after.

To run an action when a timeline is finished add a Timeline Action at the end of the timeline. You can add a timeline action by clicking the button to the left of the Timeline Actions title or double clicking in the Timeline Actions row.

.

I have a timeline that is being controlled in part by user dragging action across the screen. This is working fine, but when the drag continues after the timeline has reached the beginning or end, the actions there do not trigger. This behavior is great for the pauses I’ve put throughout the timeline, so the user can scrub smoothly through them, but actions I need fired at the end of the timeline (specifically showing other scenes) are not firing.

Any recommendations?

Timeline actions will not fire while the drag is occurring or if you end the drag at the timeline action. However if you end the drag and the timeline continues playing it should fire the timeline action. If you are seeing something different let me know and if possible send me an example Hype document (you can zip it up and drag it in the forums).

If you always want the action to fire when the timeline reaches the end (even if the user dragged all the way to the end) you will need a bit of javascript. Something like this should do the trick if you add it as a Run Javascript action on your drag action (in addition to control timeline):

if (event['hypeGesturePhase'] == hypeDocument.kHypeGesturePhaseEnd && hypeDocument.currentDirectionForTimelineNamed('timelineName') == hypeDocument.durationForTimelineNamed('timelineName')) {
    hypeDocument.showNextScene(hypeDocument.kSceneTransitionCrossfade, 1.1);
}

@stephen , is it possible to attach a little file of this working?

@stephen.

Use an @ before the persons name and they wiil be notified :grinning:

Thanks, @MarkHunte !

1 Like