Help with script please

hi I have a slide show that i’m trying to figure out,
the problem i have now is that I cant add more pictures
can someone check the code so that I can add as much pictures as I want .


slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
	if (success == true) {
			rootNode = slides_xml.firstChild;
			totalSlides = rootNode.childNodes.length;
			firstSlideNode = rootNode.firstChild;
			currentSlideNode = firstSlideNode;
			currentIndex = 1;
			updateSlide(firstSlideNode);

	}
}
//
// Updates the current slide with new image and text 
function updateSlide(newSlideNode) {
	imagePath = newSlideNode.attributes.jpegURL;
	slideText = newSlideNode.firstChild.nodeValue;
	loadMovie(imagePath, targetClip);
}
//
// Event handler for 'Next slide' button
next_btn.onRelease = function() {
	nextSlideNode = currentSlideNode.nextSibling;
	if (nextSlideNode == null) {
		break;
	} else {
		currentIndex++;
		updateSlide(nextSlideNode);
		currentSlideNode = nextSlideNode;
	}
};
//
// Event handler for 'Previous slide' button
back_btn.onRelease = function() {
	previousSlideNode = currentSlideNode.previousSibling;
	if (previousSlideNode == null) {
		break;
	} else {
		currentIndex--;
		currentSlideNode = previousSlideNode;
		updateSlide(previousSlideNode);
	}
};