# Preloading all images in Array

**URL:** <https://forum.kirupa.com/t/preloading-all-images-in-array/192548>\
**Category:** flash\
**Created:** [June 29, 2006, 10:54am UTC](https://forum.kirupa.com/t/preloading-all-images-in-array/192548 "2006-06-29T10:54:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mrrufus](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mrrufus](https://forum.kirupa.com/u/Mrrufus)\
**Post date:** [June 29, 2006, 10:54am UTC](https://forum.kirupa.com/t/preloading-all-images-in-array/192548/1 "2006-06-29T10:54:56Z")

</div>

Hi,

I’ve been fighting with this for a while now, I am trying preload several jpgs who’s locations are stored in an XML file and then display them sequentially (building a vertical list of thumbnails). What I’m having trouble to figure out is how to preload all the images with one preloader and only when all the iloading is done, to start building the list…I saw something similar here on the Forums, but couldn’t manage alter it to fit my needs.  
Any help or thoughts on how to approach this would be great!!

Here’s the code I’m using:

```auto

stop();
this.listContainer.setMask(deviceFontMask);
function loadXML(true) {
    if (true) {
        xmlNode = this.firstChild;
        projectName = [];
        buildList();
    } else {
        trace("file not loaded!");
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("../content/projects/project_listShort.xml");

//-------------------------------

function buildList() {
    spacer = 1;
    total = xmlNode.childNodes.length;
    cur = 0;
    cycle = setInterval(this, "placeItem", 110);
}
function placeItem() {
    projectName[cur] = xmlNode.childNodes[cur].firstChild.nodeValue;
    var currMovie = this.listContainer.attachMovie("pClip", "pClip"+cur, cur);
    currMovie._y += (currMovie._height+spacer)*cur;
 currMovie.loadInto.loadMovie("../content/projects/"+projectName[cur]+"/"+projectName[cur]+".jpg");
    if (++cur == total) {
        clearInterval(cycle);
    }
}

```

Thanks for any input,

Rufus
