Controlling the timeline with a for loop?

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:

btn.onRelease = function(){
this.createEmptyMovieClip(“processanim_mc”, 1);
for(var i=0; i<=20; i++);

any help would be great, cheers.