# Loading multiple images in a row

**URL:** https://forum.kirupa.com/t/loading-multiple-images-in-a-row/306906
**Category:** flash
**Created:** [March 24, 2010, 10:58am UTC](https://forum.kirupa.com/t/loading-multiple-images-in-a-row/306906 "2010-03-24T10:58:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![black\_pearl](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@black\_pearl](https://forum.kirupa.com/u/black_pearl)
#### Post date: [March 24, 2010, 10:58am UTC](https://forum.kirupa.com/t/loading-multiple-images-in-a-row/306906/1 "2010-03-24T10:58:09Z")

</div>

Hi,

I want to load multiple pictures using ActionScript. I can do it in AS2 easily. But AS3 is driving me nuts.

I am loading all the images, but I am seeing only the last one. I don’t know how to fix this.

```auto
var picWidth:int = 134;
var picGap:int = 13;
var imageLoader:Loader;
var picturesArray:Array= new Array("pic1.jpg", "pic2.jpg", "pic3.jpg", "pic4.jpg");

//Create Movieclip for Pictures
var picMc:MovieClip = new MovieClip();
picMc.x=18;
picMc.y=16;
picMc.name="Big1";
addChild(picMc);
var picLoader:MovieClip = new MovieClip();
var img_arr:Array = new Array();
for (var i:int = 0; i<picturesArray.length; i++) {
    var pic:Pictures_mc= new Pictures_mc();

    picMc.addChild(pic);
    picMc.addChild(picLoader);

    pic.x=i*(picWidth+picGap);
    picLoader.x=i*(picWidth+picGap)
    ;
    loadImage("galleryPics/"+picturesArray*);

}

function loadImage(url:String):void {

    // Set properties on my Loader object
    imageLoader = new Loader();
    imageLoader.load(new URLRequest(url));
    imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

}
function imageLoaded(e:Event):void {

    picLoader.addChild(imageLoader);

}
function imageLoading(e:ProgressEvent):void {

    // get current download progress

}

```
