Duplicate movie one at a time

I’m using


numButtons = 20;
space = button._width+5;
for (i=1; i<numButtons; i++) {
	button.duplicateMovieClip("button"+i, i);
	this["button"+i]._x = this["button"+i]._x+(i*space);
}

to duplicate some buttons, I’ve read the tutorial for using ‘while’ to duplicate movieclips, instead of ‘for’, it works in mx, but not mx04, anyone know how to do it with mx04?