# Help with attachMovieClip

**URL:** <https://forum.kirupa.com/t/help-with-attachmovieclip/12243>\
**Category:** Uncategorized\
**Created:** [January 28, 2003, 9:40pm UTC](https://forum.kirupa.com/t/help-with-attachmovieclip/12243 "2003-01-28T21:40:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioface](https://avatars.discourse-cdn.com/v4/letter/i/e5b9ba/32.png) [@ioface](https://forum.kirupa.com/u/ioface)\
**Post date:** [January 28, 2003, 9:40pm UTC](https://forum.kirupa.com/t/help-with-attachmovieclip/12243/1 "2003-01-28T21:40:44Z")

</div>

i know how to attach a Movie Clip in one line i did this code  
for(i=0; i\<10; i++) {  
\_root.attachMovie(“ball”,“ball”+i, i);  
\_root[“ball”+i].\_x=i\*\_root[“ball”+i].\_width;  
}  
so this clip will generate 10 MovieClip in one line

the one i really want to do is i want 10 lines  
and each line that will make 10 Movie Clip  
how can i achieve this??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 9:47pm UTC](https://forum.kirupa.com/t/help-with-attachmovieclip/12243/2 "2003-01-28T21:47:11Z")

</div>

for(i=0; i\<10; i++) {

for(j=0; j\<10; j++) {  
d = \_root.depth++;  
\_root.attachMovie(“ball”,“ball”+d, d);  
\_root[“ball”+d].\_x=i\*\_root[“ball”+d].\_width;  
}

}

and if you want it to be gridlike (the new 10 going down too) use  
for(i=0; i\<10; i++) {

for(j=0; j\<10; j++) {  
d = \_root.depth++;  
\_root.attachMovie(“ball”,“ball”+d, d);  
\_root[“ball”+d].\_x=i\*\_root[“ball”+d].\_width;  
\_root[“ball”+d].\_y=j\*\_root[“ball”+d].\_height;  
}

}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 9:55pm UTC](https://forum.kirupa.com/t/help-with-attachmovieclip/12243/3 "2003-01-28T21:55:17Z")

</div>

hey thanks exactly what i want to do  
but can you explain your code cuz dont really understand  
im new to AS i dont want just to apply it i want to understand it too
