# Controlling the timeline with a for loop?

**URL:** <https://forum.kirupa.com/t/controlling-the-timeline-with-a-for-loop/148775>\
**Category:** Uncategorized\
**Created:** [May 23, 2005, 3:01pm UTC](https://forum.kirupa.com/t/controlling-the-timeline-with-a-for-loop/148775 "2005-05-23T15:01:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thedailyshow](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@thedailyshow](https://forum.kirupa.com/u/thedailyshow)\
**Post date:** [May 23, 2005, 3:01pm UTC](https://forum.kirupa.com/t/controlling-the-timeline-with-a-for-loop/148775/1 "2005-05-23T15:01:56Z")

</div>

Hey everyone, my problem is a simple one I think, I’m trying to control keyframe movement but I don’t really know how. When I first created the loop, it sorta worked but the frame would skip all the way to the last instead of nextFrame(); I think it’s because the stage doesn’t update between loop iterations, I tried to correct this by onenterframe but it still didn’t work:

stop();  
btn.onRelease = function(){  
this.createEmptyMovieClip(“processanim\_mc”, 1);  
processanim\_mc.onEnterFrame;  
for(var i=0; i\<=20; i++);  
gotoAndStop(\_currentframe+1+i);  
}

any help would be great, cheers.
