Slideshow Bug

After reading dozens of tutorials I thought I’d take a wack at making my own vertical slideshow. I’ve never really messed with flash or action script before so I started off by modifying http://www.kirupa.com/developer/mx2004/xml_slideshow.htm

I’m currently stuck though. I have a gut feeling I just have one line of code or so that is incorrect. Attached you’ll find the source images, xml, fla, and swf I’m using. Below is the action script. Thank you for any help you could possibly give :slight_smile:

delay = 3000;
// -----------------------

function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        myarray = [];
        description = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
            description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
        }
        firstImage();
        
    } else {
        content = "file not loaded!";
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
p = 0;
this.onEnterFrame = function() {
    filesize = picture.getBytesTotal()+ picture1.getBytesTotal()+ picture2.getBytesTotal();
    loaded = picture.getBytesLoaded()+ picture1.getBytesLoaded()+ picture2.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
        preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
        preloader._visible = false;
        if (picture._alpha<100) {
            picture._alpha += 10;
        }
        if (picture1._alpha<100) {
            picture1._alpha += 10;
        }
        if (picture2._alpha<100) {
            picture2._alpha += 10;
        }
    }
};
function nextImage() {
    if (p<(total-1)) {
        p++;
        if (loaded == filesize) {
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            picture1._alpha = 0;
            picture1.loadMovie(image[p+1], 1);
            picture2._alpha = 0;
            picture2.loadMovie(image[p+2], 1);
            slideshow();
        }
    }
}
function firstImage() {
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[0], 1);
        picture1._alpha = 0;
        picture1.loadMovie(image[1], 1);
        picture2._alpha = 0;
        picture2.loadMovie(image[2], 1);
        slideshow();
    }
    
}

function slideshow() {
    myInterval = setInterval(pause_slideshow, delay);
    function pause_slideshow() {
        clearInterval(myInterval);
        if (p == (total-1)) {
            p = 0;
            firstImage1();
        } else {
            nextImage();
        }
    }
}
function nextImage1() {
    if (p<(total-1)) {
        p++;
        if (loaded == filesize) {
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            picture1._alpha = 0;
            picture1.loadMovie(image[p], 1);
            picture2._alpha = 0;
            picture2.loadMovie(image[p], 1);
            slideshow1();
        }
    }
}
function firstImage1() {
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[0], 1);
        picture1._alpha = 0;
        picture1.loadMovie(image[0], 1);
        picture2._alpha = 0;
        picture2.loadMovie(image[0], 1);
        slideshow1();
    }
}

function slideshow1() {
    myInterval = setInterval(pause_slideshow, delay);
    function pause_slideshow() {
        clearInterval(myInterval);
        if (p == (total-1)) {
            p = 0;
            firstImage1();
        } else {
            nextImage1();
        }
    }
}