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

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 ( 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() {
if (p == (total-1)) {
p = 0; //reset the counter p to 0
} else {

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

Any help, direction is greatly appreciated! Thanks again!