# attachMovie with names from an array

**URL:** <https://forum.kirupa.com/t/attachmovie-with-names-from-an-array/311525>\
**Category:** flash\
**Created:** [July 9, 2010, 2:19am UTC](https://forum.kirupa.com/t/attachmovie-with-names-from-an-array/311525 "2010-07-09T02:19:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@yani](https://forum.kirupa.com/u/yani)\
**Post date:** [July 9, 2010, 2:19am UTC](https://forum.kirupa.com/t/attachmovie-with-names-from-an-array/311525/1 "2010-07-09T02:19:48Z")

</div>

Hi, I’m trying to reduce repetition in my code by using a for loop with an attachMovie call.

```auto
var names:Array = new Array(name0, name1, name2);
    
    for (i = 0; i < names.length; i++)
    {
        attachMovie(names*, names*, 1)
    }

```

So I have a bunch of clips in array that I want to attach, and I just want to use the name of the clip as the instance name, but it doesnt seem to work.

Is there a way of doing this?

Thanks in advance
