# Preloading multiple External Images

**URL:** <https://forum.kirupa.com/t/preloading-multiple-external-images/197930>\
**Category:** flash\
**Created:** [August 20, 2006, 11:44pm UTC](https://forum.kirupa.com/t/preloading-multiple-external-images/197930 "2006-08-20T23:44:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nineteen](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nineteen/32/2679_2.png) [@Nineteen](https://forum.kirupa.com/u/Nineteen)\
**Post date:** [August 20, 2006, 11:44pm UTC](https://forum.kirupa.com/t/preloading-multiple-external-images/197930/1 "2006-08-20T23:44:37Z")

</div>

Hey’a, I just need a little help with this code.  
Basically I want to preload images referenced from an array into the same container\_mc.

This means that when I need to show the image in the same container\_mc I can just use the preloader again to display it… As the image is already preloaded it will instantly show.

Heres the code… Can you please help?

```auto

stop();

//Preload Array
var preload_array:Array = new Array();
preload_array[0] = "pixeldragon.jpg";
preload_array[1] = "pixeldragon2.jpg";

//bar_mc Width for Bar Percentage
var bar_mc_width:Number = bar_mc._width;

//Preloader
mc_loader = new MovieClipLoader();
preload = new Object();
mc_loader.addListener(preload);
preload.onLoadStart = function(targetMC) {
    trace("Started Loading "+targetMC);
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
    bar_mc._width = (lBytes/tBytes)*bar_mc_width;
    pText.text = Math.round((lBytes/tBytes)*100)+"%";
};
preload.onLoadComplete = function(targetMC) {
    trace("Finished Loading "+targetMC);
};

//Loop to preload each image one at a time.
for (var i = 0; i < preload_array.length; i++) {
    mc_loader.loadClip(preload_array*, container_mc);
};

play();

```
