# Arrays and attachMovie

**URL:** https://forum.kirupa.com/t/arrays-and-attachmovie/11165
**Category:** flash
**Created:** [January 13, 2003, 3:32pm UTC](https://forum.kirupa.com/t/arrays-and-attachmovie/11165 "2003-01-13T15:32:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sub0](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@sub0](https://forum.kirupa.com/u/sub0)
#### Post date: [January 13, 2003, 3:32pm UTC](https://forum.kirupa.com/t/arrays-and-attachmovie/11165/1 "2003-01-13T15:32:06Z")

</div>

hey,  
I have 6 movie clips in my library each with their own identifiers(linkage) because I want to attach them dynamically on the stage. no problem for this…  
but what about if I want to put them in an array first and then attach them on a host movie clip on the stage one after the other from left to right…so I would have 6 MC’s in line on the \_root…

thanks, sub

---

<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 13, 2003, 3:43pm UTC](https://forum.kirupa.com/t/arrays-and-attachmovie/11165/2 "2003-01-13T15:43:31Z")

</div>

[SIZE=1]what’s the question?[/SIZE]

---

<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 13, 2003, 3:52pm UTC](https://forum.kirupa.com/t/arrays-and-attachmovie/11165/3 "2003-01-13T15:52:03Z")

</div>

the question is:

how do I attach 6 different MC’s to an array which would put the attached(attachMovie()) MC’s in a host on the \_root stage, one after the other, from left to right…

thanks

---

<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 13, 2003, 5:50pm UTC](https://forum.kirupa.com/t/arrays-and-attachmovie/11165/4 "2003-01-13T17:50:41Z")

</div>

```auto

movieArray = ['mov1","mov2","mov3", ... "mov10"];

function addMovies(movieArray){
   var i,m,pm
   for(i in movieArray){
      pm = m;
      m = _root.attachMovie(movieArray*,movieArray*+"_mov",i);
      m._x = pm._x + pm._width;
   }
}

addMovies(movieArray);

```

the spacing relies on the movies’ registration points being on the lefmost edge.
