Slideshow / XML Gallery Help!

Hi there, this is my first post! I am not a programmer, but have managed to combine the slideshow, image gallery and hover features of the provided scripts to create a slideshow that you can control with the previous and next buttons. I have also been able to connect it to an access database so you can control the images / info through Content Management console . . . . . once this has been sorted I will post the code here, if its any use to anyone.

Here is the script!

delay = 5000;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
url = [];
link = [];
caption = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
url* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
caption* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;

    }
    firstImage();
} else {
    content = "file not loaded!";
}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images_sort.asp”);
// ///////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
// ///////////////////////////////////
p = 0;
spacing = 10;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.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 (Math.round(filesize/loaded) == 1 &&

picture._width != 0 && picture._height != 0) {
var w = picture._width+spacing, h =

picture._height+spacing;
border.resizeMe(w, h, id);

    }
}
};
//getURL statement
picture.onRelease = function() {
    getURL(link[p], "_blank");
};
//
//Hover Caption
picture.onRollOver = function() { 
captionFN(true, caption[p], this); 
this.onRollOut = function() { 
captionFN(false); 

};
};
//
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
link_txt.text = url[p];
cap.desc.text = caption[p];
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p–;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
link_txt.text = url[p];
cap.desc.text = caption[p];
slideshow();
picture_num();

}

}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
link_txt.text = url[0];
cap.desc.text = caption[0];
slideshow();
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}

};

//Hover Caption Function
captionFN = function (showCaption, captionText, bName) {
if (showCaption) {
_root.createEmptyMovieClip(“hoverCaption”, this.getNextHighestDepth());
cap.desc.text = captionText;
cap._width = 5*cap.desc.text.length;
cap._alpha = 100;
//
if ((bName._width+bName._x+cap._width)>Stage.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
cap._x = _root._xmouse+xo+10;
cap._y = _root._ymouse+yo;
cap._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
cap._visible = false;
}
};

It works great, apart from when I interupt the slideshow, the image selection goes mental - it starts ignoring where it is and what the interval is set to.

Has anyone alny ideas . . . . . .!

Thanks in advance

Pete