# Trouble with While{} and duplicateMovieClip

**URL:** <https://forum.kirupa.com/t/trouble-with-while-and-duplicatemovieclip/156010>\
**Category:** flash\
**Created:** [July 21, 2005, 9:21pm UTC](https://forum.kirupa.com/t/trouble-with-while-and-duplicatemovieclip/156010 "2005-07-21T21:21:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![getoverit](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@getoverit](https://forum.kirupa.com/u/getoverit)\
**Post date:** [July 21, 2005, 9:21pm UTC](https://forum.kirupa.com/t/trouble-with-while-and-duplicatemovieclip/156010/1 "2005-07-21T21:21:41Z")

</div>

Hello, I’m trying to make a matrix of movie clips. To do this, I have two while statements, one inside the other. The interior is for the number of columns and the exterior is for the number of rows. The movieclip that I want in every entry of the matrix is called ‘entryspace’. What ends up happening is that only the last row shows up at the bottom. There must be an error in the following but I can’t find it. I’ve also attached the entire file. Please help, somebody. Thanks  
-Steve

on (release) {  
i = 0;  
xspot = 500;  
yspot = 90;  
TestArray = new Array();  
TestArray.length = columns-1;  
TestArray.push(columns);  
i = 0;  
j = 0;  
while (j\<rows) {  
while (i\<columns) {  
duplicateMovieClip ("\_root.entryspace", “entryspace”+j+i, i);  
\_root[“entryspace”+j+i].\_x = xspot;  
\_root[“entryspace”+j+i].\_y = yspot;  
\_root[“entryspace”+j+i].entry = i+1;  
i++;  
xspot -= 40;  
}  
i=0;  
xspot = 500;  
yspot += 36;  
j++;  
}  
}
