# Duplicate movie clips

**URL:** <https://forum.kirupa.com/t/duplicate-movie-clips/271647>\
**Category:** Uncategorized\
**Created:** [September 25, 2008, 8:13pm UTC](https://forum.kirupa.com/t/duplicate-movie-clips/271647 "2008-09-25T20:13:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gppenati](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gppenati](https://forum.kirupa.com/u/gppenati)\
**Post date:** [September 25, 2008, 8:13pm UTC](https://forum.kirupa.com/t/duplicate-movie-clips/271647/1 "2008-09-25T20:13:50Z")

</div>

I have a project where I have multiple rows and columns being populated by little smiley faces. My issue is twofold.

1. I need the smiley faces to come in one by one very quickly so you can see the pages filling up with faces.
2. I need the smiley faces to come in Randomly and still remain in the rows and colums.

Here is the code:  
// enter how many rows and columsn you want?  
rows = 50;  
columns = 100;  
// starting positions of your first smile  
xpos = 0;  
ypos = 0;  
// spacing between each smile  
vspace = 2;  
hspace = 2;  
// the width and height of your smile mc  
wclip = smile.\_width;  
hclip = smile.\_height;  
// our counter  
theclip = 1;  
// make our grid  
for (var i = 0; i\<rows; i++) {  
for (var j = 0; j\<columns; j++) {  
var thematrix = smile.duplicateMovieClip(“smile”+theclip, theclip+1);  
thematrix.\_x = xpos+((wclip+hspace)\*j);  
thematrix.\_y = ypos+((hclip+vspace)\*i);  
theclip++;  
}  
}

Please help:sonic:
