Duplicate Mc

hi, this code is an example:
for (i=1; i<=10; i++) {
_root.box.duplicateMovieClip( “box”+i, i);
_root[“box”+i]. _x=_root[“box”+i]. _x+20;
}

What I want to do is multiplicate a MC on the_x and if the_x, imagine, is bigger than 760 for exemple, it go down one rown and start again duplicating the mc´s

the code up, only put´s one copy of the MC more 20 px in front

thanks

Basically you need two for loops to make rows of an object. This code should help you.


xBoxs = 6;
yBoxs = 6;
xSpace = 30;
ySpace = 30;
xMiddle = Stage.width/2;
yMiddle = Stage.width/2;
for(y=0; y<yBoxs; y++){
	for(x=0; x< xBoxs; x++){
		dag= attachMovie("box", "b"+i, i++);
		trace(dag);
		dag._x = (x-(xBoxs-1)/2)*xSpace+xmiddle;
		dag._y = (y-(yBoxs-1)/2)*ySpace+ymiddle;
	
	}
}
		

:slight_smile: