# Dynamic Movie clips help

**URL:** <https://forum.kirupa.com/t/dynamic-movie-clips-help/301746>\
**Category:** flash\
**Created:** [December 15, 2009, 2:01am UTC](https://forum.kirupa.com/t/dynamic-movie-clips-help/301746 "2009-12-15T02:01:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chevron8653](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@chevron8653](https://forum.kirupa.com/u/chevron8653)\
**Post date:** [December 15, 2009, 2:01am UTC](https://forum.kirupa.com/t/dynamic-movie-clips-help/301746/1 "2009-12-15T02:01:14Z")

</div>

Hi there, I was wondering if i could get a bit of help with something.

I am wanting to make it so i have a movie clip on the stage named say, Library\_mc. then in the timeline I have Movie clips labled from address1\_mc to address30\_mc and so on, and what i want it to do is dynamically load one of the address\_mc movie clips onto the stage depending on what a number variable is at.

I followed a scrollPane tutorial here on kirupa which pretty much does what i want, and i modified it to load the things into a Loader insead of a scrollPane but it creates new movie clips from the address1\_mc it dosent actually take ones from the library and onto the stage.

heres the code i got now.

```auto

var i:Number = 0;
var mcMain:MovieClip;
var haltadd:Array = ["add"];
function init() {
    //empty movie clip in library with linkage name "library"
    addlist.contentPath = "library";
    mcMain = addlist.content;
    trace(mcMain);

}
init();

function addmore() {
    trace(library.address_mc);
    if (_root.haltadd[0] == "add") {
        //attaching address to the content location stored in mcMain
        mcMain.attachMovie("address1_mc","address"+i,mcMain.getNextHighestDepth(),{_y:39*i+3, _x:5});
        i++;
        addlist.invalidate();
    }
    if (_root.i>+7) {
        _root.haltadd[0] = "stop";
    }

}
setInterval(addmore,550);

```

Is there any way i can modifiy this so it adds it into a movieclip instead of the Loader, coz I cant even figure out how to target the address movie clips that get attatched into the loader stuff.

Thanks any helpwould be appreciated.
