# Need help making a for loop to onEnterFrame

**URL:** <https://forum.kirupa.com/t/need-help-making-a-for-loop-to-onenterframe/77132>\
**Category:** Uncategorized\
**Created:** [January 24, 2005, 10:03pm UTC](https://forum.kirupa.com/t/need-help-making-a-for-loop-to-onenterframe/77132 "2005-01-24T22:03:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzales](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gonzales](https://forum.kirupa.com/u/gonzales)\
**Post date:** [January 24, 2005, 10:03pm UTC](https://forum.kirupa.com/t/need-help-making-a-for-loop-to-onenterframe/77132/1 "2005-01-24T22:03:14Z")

</div>

hi all,

i posted this question last week and didnt get much of a response. im making an image gallery and have a for loop that plots the thumbnail grid. i need help converting it to onEnterFrame so that the thumbnails are created one by one… heres my as:

[AS]  
gridx = 21;  
//x spacing  
gridy = 21;  
// yspacing  
num = 0;  
numOfImages = image.length;  
//////////////////  
function makeThumbs() {  
\_root.navContainer.thumb.\_visible = 0;  
clearInterval(delay);  
var i = 0;  
var k = -1;  
while (i\<image.length) {  
k++;  
for (var j = 0; j\<10 && i\<image.length; i++, j++) {  
\_root.navContainer.thumb.duplicateMovieClip(“th”+num, num);  
thmb.id = this.\_name.substring(2);  
thmb = \_root.navContainer[“th”+num];  
thmb.\_x = thmb.\_x+gridx_j;  
thmb.\_y = thmb.\_y+gridy_(k);  
num++;  
thmb.info.text = Number(thmb.\_name.substring(2))+1;  
thmb.thumbs\_mc.loadMovie(thumbnails\*);  
thmb.onRelease = function() {  
this.onEnterFrame = function() {  
picture.prevFrame();  
//trace(“i am thmb’s onEnterFrame”);  
if (picture.\_currentframe == 1) {  
showImage(this.\_name.substring(2));  
picture.\_alpha = 0;  
delete this.onEnterFrame;  
}  
};  
//trace(this.\_name.substring(2));  
};  
}  
}  
}  
[/AS]
