# XML Slide Show

**URL:** <https://forum.kirupa.com/t/xml-slide-show/26633>\
**Category:** flash\
**Created:** [July 24, 2003, 9:27pm UTC](https://forum.kirupa.com/t/xml-slide-show/26633 "2003-07-24T21:27:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hagel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hagel/32/262_2.png) [@hagel](https://forum.kirupa.com/u/hagel)\
**Post date:** [July 24, 2003, 9:27pm UTC](https://forum.kirupa.com/t/xml-slide-show/26633/1 "2003-07-24T21:27:36Z")

</div>

I am working on a slide show that uses XML to link to the pics and the text under the pics. What I am wanting to do is have the pics fade in and out when the user clicks on a next and previous button. From the script I have is there a way to just add this functionality in, or can any direct me to a tutorial or .fla that will show me how to achieve this effect?

I have found a way to make it happen with a time based script, but haven’t been able to adapt the time based script to user interactions (clicks).

\<code\>  
slides\_xml = new XML();  
slides\_xml.onLoad = startSlideShow;  
slides\_xml.load(“xml/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;  
targetClip.loadMovie(imagePath);  
}  
//  
// 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);  
}  
};  
\</code\>

## Thanks 🙂

Michael Hagel

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2003, 11:22pm UTC](https://forum.kirupa.com/t/xml-slide-show/26633/2 "2003-07-24T23:22:48Z")

</div>

BUMP

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2003, 12:17pm UTC](https://forum.kirupa.com/t/xml-slide-show/26633/3 "2003-07-25T12:17:52Z")

</div>

??? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 9:01pm UTC](https://forum.kirupa.com/t/xml-slide-show/26633/4 "2003-07-26T21:01:08Z")

</div>

??
