Help converthing this while loop to onEnterFrame

can anyone help me convert this loop to onEnterFrame? i used pom’s tutorial on making grids but i want flash to create it frame by frame…

help a brotha out?

[AS]
function makeThumbs() {
thumb._visible = 0;
clearInterval(delay);
var i = 0;
var k = 0;
while (i<image.length) {
k++;
for (var j = 1; j<7 && i<image.length; i++, j++) {
thumb.duplicateMovieClip(“th”+num, num);
thmb.id = this._name.substring(2);
thmb = _root[“th”+num];
thmb._x = thmb._x+gridxj;
thmb._y = thmb._y+gridy
(k);
num++;
thmb.info.text = this._name.substring(2);
thmb.thumbs_mc.loadMovie(thumbnails*);
thmb.onRelease = function() {
showImage(this._name.substring(2));

		};
	}
}

}
[/AS]