# Slideshow using XML to stop looping and fade out at the end

**URL:** <https://forum.kirupa.com/t/slideshow-using-xml-to-stop-looping-and-fade-out-at-the-end/202310>\
**Category:** flash\
**Created:** [September 29, 2006, 3:09pm UTC](https://forum.kirupa.com/t/slideshow-using-xml-to-stop-looping-and-fade-out-at-the-end/202310 "2006-09-29T15:09:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![njoay](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@njoay](https://forum.kirupa.com/u/njoay)\
**Post date:** [September 29, 2006, 3:09pm UTC](https://forum.kirupa.com/t/slideshow-using-xml-to-stop-looping-and-fade-out-at-the-end/202310/1 "2006-09-29T15:09:47Z")

</div>

Hi all,

I know a lot of XML slideshow questions and adaptations have been posted and I’ve searched but I can’t seem to find the answer to my problem. I used the tutorial "Photo Slideshow Using XML and Flash and I’ve successfully implemented the slideshow to fade in and out, but I don’t want the slideshow to loop - ie. to stop looping then stop at the last image and fade out to about 50% and then some text with a clippable link to pop up.

I’ve used the code from the above mentioned tutorial ([http://www.kirupa.com/developer/mx2004/xml\_slideshow.htm](http://www.kirupa.com/developer/mx2004/xml_slideshow.htm)) and deleted the preloader, next, and previous button AS. And I’ve modified the slideshow function to make the slideshow not loop by commenting out firstImage (as shown below) but I can’t make it fade out. And I’ve implemented another function called fadeout but it fades out my entire stage. I would only like to fade out the last image and have some text pop up. Here’s the AS:

function slideshow() {  
myInterval = setInterval(pause\_slideshow, delay);  
function pause\_slideshow() {  
clearInterval(myInterval);  
if (p == (total-1)) {  
p = 0; //reset the counter p to 0  
//firstImage();  
fadeout();  
} else {  
nextImage();  
}  
}  
}

function fadeout() {  
this.\_alpha -= 50;  
if (this.\_alpha\<=0) {  
this.\_alpha = 100;  
}  
}

Any help, direction is greatly appreciated! Thanks again!
