XML Slideshow Issue - Images Out of Order

Hello,

I’m using a vertical image slideshow, and I have a slight problem. It seems that when the SWF loads the images, they are often not in the order of the XML file. For example, in the XML, image 1 may not show up until the 5th - 6th image. In one case, the entire set of images was completely reversed, with the 76th image being 1st, and the 1st being last. Can someone look over this and let me know what I can do to correct this? I got the code from here quite some time ago, and it’s been a long time since I’ve had to mess with Flash. The slideshow code is:

Call XML


function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        thumbnails = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
            thumbnails* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
            thumbnails_fn(i);
        }
        firstImage();
    } else {
        content = "file not loaded!";
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

Thumbnail Scroller Code


function thumbNailScroller() {
    // thumbnail code! 
    this.createEmptyMovieClip("tscroller", 1000);
    scroll_speed = 10;
    tscroller.onEnterFrame = function() {
        if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
            if ((_root._ymouse>=(hit_right2._y-40)) && (thumbnail_mc.hitTest(hit_right2))) {
                thumbnail_mc._y -= scroll_speed;
            } else if ((_root._ymouse<=(hit_left2._y+40)) && (thumbnail_mc.hitTest(hit_left2))) {
                thumbnail_mc._y += scroll_speed;
            }
        } else {
            delete tscroller.onEnterFrame;
        }
    };
}

var myvar = 0;
function thumbnails_fn(k) {
    thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
    tlistener = new Object();
    tlistener.onLoadInit = function(target_mc) {
        target_mc._y = myvar;
        myvar += target_mc._height+5;
        //trace(target_mc._width+" "+target_mc._parent._rotation)
        target_mc.pictureValue = k;
        target_mc.onRelease = function() {
            p = this.pictureValue-1;
            nextImage();
        };
        target_mc.onRollOver = function() {
            this._alpha = 50;
            thumbNailScroller();
        };
        target_mc.onRollOut = function() {
            this._alpha = 100;
        };
    };
    image_mcl = new MovieClipLoader();
    image_mcl.addListener(tlistener);
    image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

XML File


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>

    <pic>
        <image>01.jpg</image>
        <thumbnail>thumbs/thumb01.jpg</thumbnail>
    <pic>
        <image>02.jpg</image>
        <thumbnail>thumbs/thumb02.jpg</thumbnail>
    </pic>
    <pic>
        <image>03.jpg</image>
        <thumbnail>thumbs/thumb03.jpg</thumbnail>
    </pic>
          <pic>
        <image>04.jpg</image>
        <thumbnail>thumbs/thumb04.jpg</thumbnail>
    </pic>
     <pic>
        <image>05.jpg</image>
        <thumbnail>thumbs/thumb05.jpg</thumbnail>
    </pic>
     <pic>
        <image>06.jpg</image>
        <thumbnail>thumbs/thumb06.jpg</thumbnail>
    </pic>
    <pic>
        <image>07.jpg</image>
        <thumbnail>thumbs/thumb07.jpg</thumbnail>
    </pic>
    <pic>
        <image>08.jpg</image>
        <thumbnail>thumbs/thumb08.jpg</thumbnail>
    </pic>
    <pic>
        <image>09.jpg</image>
        <thumbnail>thumbs/thumb09.jpg</thumbnail>
    </pic>
     <pic>
        <image>10.jpg</image>
        <thumbnail>thumbs/thumb10.jpg</thumbnail>
    </pic>
</images>

Please help!