# Attaching movie clips to another movie clip

**URL:** <https://forum.kirupa.com/t/attaching-movie-clips-to-another-movie-clip/230550>\
**Category:** Uncategorized\
**Created:** [June 27, 2007, 5:24am UTC](https://forum.kirupa.com/t/attaching-movie-clips-to-another-movie-clip/230550 "2007-06-27T05:24:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alaetra](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@alaetra](https://forum.kirupa.com/u/alaetra)\
**Post date:** [June 27, 2007, 5:24am UTC](https://forum.kirupa.com/t/attaching-movie-clips-to-another-movie-clip/230550/1 "2007-06-27T05:24:02Z")

</div>

I’m attaching (and then removing) relevant movie clips to an empty movie clip that is shown in a scrollpane. It all works fine when triggered from buttons, but when the flash file is first loaded no clip is attached and thus nothing is displayed in the scrollpane. What am I doing wrong?

This is the function I trigger through the buttons and when the file is first loaded:  
function loadScroll(the\_page)  
{  
//create delay for component to initialize  
i = 1;  
this.onEnterFrame = function()  
{  
i++;

```
    if (i&gt;5) 
    {
        switch (the_page)
        {
            case "xmlGallery.html":
                empty_mc.testreal_mc.removeMovieClip();
                empty_mc.attachMovie("gallery", "galleryreal_mc", empty_mc.getNextHighestDepth());
                scrollpane.invalidate();
            break;
            default:
                empty_mc.galleryreal_mc.removeMovieClip();
                empty_mc.attachMovie("test_mc", "testreal_mc", empty_mc.getNextHighestDepth());
                empty_mc.testreal_mc.myTable.createTable(the_page);
                scrollpane.invalidate();
        }
        delete this.onEnterFrame;
    }
};
test_mc.myTable.onTableRendered = function() 
{
    scrollpane.hScrollPolicy = "false";
};

loadPicture();

```

}
