# Help with script please

**URL:** https://forum.kirupa.com/t/help-with-script-please/49864
**Category:** Uncategorized
**Created:** [April 27, 2004, 11:52am UTC](https://forum.kirupa.com/t/help-with-script-please/49864 "2004-04-27T11:52:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ken](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@ken](https://forum.kirupa.com/u/ken)
#### Post date: [April 27, 2004, 11:52am UTC](https://forum.kirupa.com/t/help-with-script-please/49864/1 "2004-04-27T11:52:14Z")

</div>

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 .

```auto

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);
	}
};

```
