# (Mx04) Generate mc's in rows

**URL:** <https://forum.kirupa.com/t/mx04-generate-mcs-in-rows/194348>\
**Category:** flash\
**Created:** [July 22, 2006, 1:01pm UTC](https://forum.kirupa.com/t/mx04-generate-mcs-in-rows/194348 "2006-07-22T13:01:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mizztah\_H](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mizztah\_H](https://forum.kirupa.com/u/Mizztah_H)\
**Post date:** [July 22, 2006, 1:01pm UTC](https://forum.kirupa.com/t/mx04-generate-mcs-in-rows/194348/1 "2006-07-22T13:01:06Z")

</div>

Hi

I can usually find/work out the answers from using the tutes but I’m stuck so I thought I’d ask here.

Following on from this post -

[http://www.kirupa.com/forum/showthread.php?t=227686](http://www.kirupa.com/forum/showthread.php?t=227686)

I want the clips to be displayed in, for example, 2 rows of 3 clips, 6 in total.

By modding the AS to

total = 6;  
for (i=0; i\<total; i++) {  
t = \_root.createEmptyMovieClip(“xml”+i, i);  
loadMovie(“imgBack.jpg”, “xml”+i);  
}  
t.\_x = (50\*i) + 5  
if (t.\_x \> 400){  
t.\_y = 300;  
}  
else{  
t.\_y = 100;  
}

I seem to have only the first clip displayed in the first row and the last clip in the last row.

What have I done wrong and how can I correct it?

I realise that the size of the jpg determines the point at which the second row is displayed so can I do it easily by determining that the third mc has been reached so start a new row?

cheers

Lee
