/**
* Replace type with one of the following values:
* "cycle" - this will repeat your animation from the beginning
* "pingpong" - alternates back and forth between keyframes
* "offset" - similar to cycle, only this will offset the values by the original
* "continue" - carries on the animation with the same velocity as the last keyframe
*/
loopOut(type);
/**
* If a position property has two keyframes and this expression applied
* then when the time marker gets to the last keyframe it will
* then repeat the animation from the first keyframe
**/
loopOut("cycle");
Apply the following expression to a property with at least two keyframes
loopOut("pingpong");
To only loop back and forth between the final two keyframes of an animation, you need to use the optional numKeyframes value like so:
loopOut("pingpong", 1);
To loop between the last three keyframes, you need to use the optional numKeyframes value and set it to (3 - 1 = 2)
loopOut("pingpong", 2);
Where n is the number of keyframes you want to loop between, set the second value to (n - 1)
/**
* For example:
* If you want to loop between the last 4 keyframes the second value would be:
* 4 - 1 = 3
**/
loopOut("pingpong", 3);