How can I make the following code work in the attached hype document to allow the user to advance though a timeline from start to finish and then loop back around infinite times?
var currentTime = hypeDocument.currentTimeInTimelineNamed('Main Timeline');
hypeDocument.goToTimeInTimelineNamed((currentTime + 0.5), 'Main Timeline');
the hype document attached contains a no code version that works as planned, and a version where multiple buttons have been replaced with a single one which has a javascript function applied on click.
var currentTime = hypeDocument.currentTimeInTimelineNamed('Main Timeline');
// console.log(x); // Note that Javascript uses a different format for the time in the timeline
hypeDocument.goToTimeInTimelineNamed(currentTime + 0.5, 'currentTime');
The Main TimeLine will continue after each click unless you add pauses in your script.
thanks, this is working great. I added a timeline action at the end of the animation assuming it would loop back to the start, but it stays put - how can I make the animation loop so the button can be clicked infinite times?