# Help with looping

**URL:** <https://forum.kirupa.com/t/help-with-looping/71161>\
**Category:** Uncategorized\
**Created:** [November 21, 2004, 9:48pm UTC](https://forum.kirupa.com/t/help-with-looping/71161 "2004-11-21T21:48:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)\
**Post date:** [November 21, 2004, 9:48pm UTC](https://forum.kirupa.com/t/help-with-looping/71161/1 "2004-11-21T21:48:33Z")

</div>

I have a toon im making (just for experimentational reasons), but for a walking I want the feet to spin (you’ll see what i mean in the fla) 5 times before stopping.  
I have this code on the end of the foot movieclip:  
[AS]stop();  
i = 1;  
if (i\<5) {  
i++;  
gotoAndPlay(1);  
} else {  
stop();  
}[/AS]

But even with that code the feet just continue moving, am I missing something in the code, or something else?
