I’m new to actually using Hype (even though I’ve owned it since version 1). I have an animation that I’d like to pause on mouse click and then continue playing after second mouse click. Is this possible without using JavaScript?
My JS knowledge is pretty much nil. It seems like this should be a really basic functionality though, but if so, I can’t figure it out. Any help would be appreciated.
Wow. Another way to skin the cat. This is a very clever approach, although I’m thinking it would only work when the animation can play equally well in either direction (as is the case with the oscillating ball). The two timeline approach does allow the animation to play in the same direction.
In any case, I will try to implement your logic on my own animation (as I did with Max’s suggestion yesterday). Getting these to work has been a great learning tool for me and has answered a lot of questions.
Not sure I follow your logic in regards to a Toggle button for play/pause..
The Toggle is just the control. i.e sets the behaviour of the play/pause button and in the example we do not change the direction of the animation on the main timeline we either pause it or continue it. The looping of the animation is down to what is set on the main timeline animation.
Maybe I’m missing something (it wouldn’t be the first time), but the animation you put together has a timeline that plays the sequence in reverse order after the first pass. I’m looking to play in a sequence like 1 2 3 4 1 2 3 4, as opposed to 1 2 3 4 4 3 2 1. I want the contents to always play in a “one-directional” ordered sequence no matter where it is paused.
I put together an example, using the “one additional timeline” example you suggested and the “two additional timelines” example that MaxZieb suggested (good practice for me). Hopefully, this will explain my sequencing issue. And maybe there’s still a way to do it with your timeline, but I haven’t been able to accomplish it. (The “Inner HTML” thing was a good trick for changing the button text. Thanks for that tip!)
If I understand things correctly then You would just need to make one change to your set-up in Scene “One Timelines” (I did not use the second Scene)… in the “Timeline Action” at 2 seconds; “Main Timeline”.
Yep. That did it. Yesterday, I tried unchecking the “Play in reverse” and changing the action to “Start timeline” with odd results (although when I try it today, that works too). Duh.