It is possible in Moho to automatically cycle a section of animation, repeating it over and over as many times as you wish. Cycling is a special type of keyframe interpolation, and this tutorial will show you how to set it up.
For this tutorial, we'll start with a project file that's almost finished. It's named "Tutorial 5.5" and it's located in the "Tutorials/5 - Animation" subfolder within the main Moho folder. In the timeline, you can see that the top layer, "Red Blinker", has two keyframes in the Layer Visibility channel. The layer becomes invisible at frame 36, and visible again at frame 48. This is also shown by the red background in the timeline during the layer's invisible period:
Starting point for this tutorial.
You can play back the animation to see what's going on. Basically, the red light starts off turned on, then it shuts off for a while and finally turns back on.
Using cycling, you can make the light blink over and over. Right-click on the second keyframe (the one at frame 48), and in the popup menu that appears, select "Cycle...". You're telling Moho that after this keyframe, you want the animation to cycle back to an earlier point in the animation. A dialog will appear asking you the specifics of the cycling. Enter the values shown below:
Cycle settings.
When you click OK in the cycle dialog, the timeline will update to show the cycle. There are three changes you will see: First, the keyframe in question will change to a left-pointing arrow to indicate that it cycles backwards. Second, a long red arrow will point back to the point in the timeline that the visibility channel is cycling back to. Third, later in the timeline you will see other sections with red backgrounds to indicate that the layer is invisible during those periods:
Cycling reflected in the timeline.
You can play back the animation again to see the result. The "Red Blinker" layer will flash on and off multiple times, even though you didn't add any more keyframes - the Layer Visibility channel is just cycling back and repeating a section of animation over and over again.
Let's try adjusting the cycle duration. In the Timeline window, hold down the <ctrl> key while you click and drag on the second keyframe (the one that cycles). As you drag the mouse side-to-side, you'll see that the cycle duration changes, as the arrow that points back from the cycling key gets longer and shorter. Adjust the cycle duration so that the keyframe cycles back to frame 24:
Adjusted cycle duration.
If you play back the animation now, you'll see that the light blinks more quickly now, since the cycle duration is shorter.
Finally, to break a cycle, all you have to do is add another keyframe when you want the cycle to end. Set the current frame to 102, right click in the Layer Visibility channel, and select "Add Keyframe" from the popup menu that appears. The new keyframe will appear, and at that point the cycling will end. Play back the animation to confirm this.
New keyframe at frame 102.
Cycling can be used in any animation channel in Moho. Any keyframe can be made to cycle back in time by setting "Cycle" as the key's interpolation method. You can cycle a channel all the way back to the beginning of an animation, or just back a few frames. Cycling will repeat itself forever or until a new keyframe is reached.