# Preloading into movieclips located in the library

**URL:** <https://forum.kirupa.com/t/preloading-into-movieclips-located-in-the-library/222995>\
**Category:** flash\
**Created:** [April 18, 2007, 5:03pm UTC](https://forum.kirupa.com/t/preloading-into-movieclips-located-in-the-library/222995 "2007-04-18T17:03:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsochar](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bsochar/32/3116_2.png) [@bsochar](https://forum.kirupa.com/u/bsochar)\
**Post date:** [April 18, 2007, 5:03pm UTC](https://forum.kirupa.com/t/preloading-into-movieclips-located-in-the-library/222995/1 "2007-04-18T17:03:24Z")

</div>

I need to load external .swfs into movie clips I have in my library.

I think I’m missing something here. I have 30 movieclips in my library (instance\_1, instance\_2, etc…) They all have a unique linkage (instance\_1, instance\_2, etc…) and are placed far off stage in the 2nd frame then are placed into an array and tweened via actions script. I want to make each one load an external .swf in a sequnce when the playhead enters the frame my 3D code is in. My problem appears to be with attachmovie or some other function…

here is the site:  
[http://bravist.com/bravist.html](http://bravist.com/bravist.html)  
-You can see I currently have a preloader (similar to one here on kirupa [http://www.kirupa.com/developer/actionscript/moviecliploader.htm](http://www.kirupa.com/developer/actionscript/moviecliploader.htm)) in the first 3 movieclips, but I want one common preloader that draws the external files from an array and places them into my clips

here is a section of my code that controls my movieclips:

```auto
var numItems = 29;                   
var focalLength = 1000;                         
var centerX = (Stage.width *.5);
var centerY = (Stage.height*.5);

    for(var i = 0; i<=numItems;i++){
        this.attachMovie("instance_" + i, "instance_mc_"+i,i);
        clip = this["instance_mc_"+i];

myXYarray = new Array([(Stage.width*.217)-centerX, (Stage.height*.25)-centerY],
                                  [(Stage.width*.224)-centerX, (Stage.height*.26)-centerY],        
                                  [(Stage.width*.231)-centerX, (Stage.height*.27)-centerY],       
                                  [(Stage.width*.238)-centerX, (Stage.height*.28)-centerY],        
                                  [(Stage.width*.245)-centerX, (Stage.height*.29)-centerY],     
                clip.x = myXYarray*[0];
                clip.y = myXYarray*[1];
                
                
myzarray = new Array([(focalLength*.150)-focalLength],
                                [(focalLength*.175)-focalLength], 
                                [(focalLength*.200)-focalLength], 
                                [(focalLength*.225)-focalLength], 
                                [(focalLength*.250)-focalLength], 
                clip.z = myzarray*[0];

        clip.swapDepths(-clip.z);

```

As you can see I already have attachmovie to load my clips into the array, but I can’t get a preloader to work.

Many Thanks,
