# How to loop animation

**URL:** <https://forum.kirupa.com/t/how-to-loop-animation/302641>\
**Category:** flash\
**Created:** [January 4, 2010, 10:14pm UTC](https://forum.kirupa.com/t/how-to-loop-animation/302641 "2010-01-04T22:14:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mcchan](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Mcchan](https://forum.kirupa.com/u/Mcchan)\
**Post date:** [January 4, 2010, 10:14pm UTC](https://forum.kirupa.com/t/how-to-loop-animation/302641/1 "2010-01-04T22:14:04Z")

</div>

Hi, I’m trying to figure out a method that can do this

Jump to and play at frame 5.

play frame 5 until it reaches frame 20

When reaches frame 20, repeat back to frame 5 and do it over again.

The process is repeated while a ‘down arrow’ button is pressed. It breaks when button is released.

Can someone think of an algorithm or method? I’m very new to actionscript.
