# Attatching several movie clips from the library

**URL:** <https://forum.kirupa.com/t/attatching-several-movie-clips-from-the-library/234738>\
**Category:** Uncategorized\
**Created:** [August 5, 2007, 2:43pm UTC](https://forum.kirupa.com/t/attatching-several-movie-clips-from-the-library/234738 "2007-08-05T14:43:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![obsolete](https://avatars.discourse-cdn.com/v4/letter/o/ba8739/32.png) [@obsolete](https://forum.kirupa.com/u/obsolete)\
**Post date:** [August 5, 2007, 2:43pm UTC](https://forum.kirupa.com/t/attatching-several-movie-clips-from-the-library/234738/1 "2007-08-05T14:43:31Z")

</div>

Hu

I’m having a problem with attaching several mc dimanycly.

here is my code

```auto
package {
    import flash.*;

    public var arrayMc:Array= ["backGround", "image1","image2","image3"];
    public class attachBackGround extends Sprite {
        public function attachMC() {
            for (var a:int=0; a<arrayMc.length; a++) {
                var _container:Sprite = new Sprite();
                addChild(_container);
                var v:arrayMc[a]= new arrayMc[a]();
                _container.addChild(new v);
            }
        }
    }
}

```

I always get an error, and I can’t see to pass the name of the movie to be attached dinamycly.

Thanks

jm
