# MovieClip problem

**URL:** <https://forum.kirupa.com/t/movieclip-problem/205239>\
**Category:** flash\
**Created:** [October 27, 2006, 10:42am UTC](https://forum.kirupa.com/t/movieclip-problem/205239 "2006-10-27T10:42:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![achilehero](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@achilehero](https://forum.kirupa.com/u/achilehero)\
**Post date:** [October 27, 2006, 10:42am UTC](https://forum.kirupa.com/t/movieclip-problem/205239/1 "2006-10-27T10:42:49Z")

</div>

Please, somebody explain the difference between:

_while(i\<Stage.width){  
while(j\<Stage.height){  
mcTemp=mcmask.attachMovie(“mask\_ani”,“m” + mcmask.getNextHighestDepth(),mcmask.getNextHighest Depth());  
mcTemp.\_x = i;  
mcTemp.\_y = j;  
arr.push(mcTemp);  
j+=15;  
}  
i+=15;  
j=0;  
}_

which works just fine (creates a clip, attaches another clip from the library to it and then stores a reference into an array)

and

_for(count=1;count\<=nPics;count++){  
pcm=imagcont.createEmptyMovieClip(“pic”+count,imag count.getNextHighestDepth());  
pcm.loadMovie(“image”+count+".jpg");  
p.push(pcm);  
}_

which is supposed to create an empty clip, load an image in it, and store it into an array, but it doesn’t work.  
In the end, in the p array I just get the first 4 records empty, and only the last (nPics is 5 in my example) is what it is supposed to be.

Thanks a lot,

Chris
