Slideshow pause-fadeOut-fadeIn. Help needed

Hi there, I’m making a banner for a personal site that cycles through a set of images loaded from XML (makes it easier to add/remove images whenever I need to) and I have used the slidshow script located here: http://www.kirupa.com/developer/mx2004/xml_slideshow.htm for the base.

What I have so far is working as expected, my images load with a fade in effect pause for a moment then cut off and the next image loads with the fade in effect (loop).

My problem is that I would like the images to fade out (quicker than the fade in) after the short pause but I cant work out where in the script I need to execute this.

Here is the script so far:


pauseDelay = 6000;
this.fadeInSpeed = 3;
this.fadeOutSpeed = 6;
// -----------------------
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		image = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			image* = xmlNode.childNodes*.attributes.src;
		}
		firstImage();
	} else {
		content = "file not loaded!";
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

this.onEnterFrame = function() {
	filesize = picture.getBytesTotal();
	loaded = picture.getBytesLoaded();
	preloader._visible = true;
	if (loaded != filesize) {
		preloader.preload_bar._xscale = 100*loaded/filesize;
	} else {
		preloader._visible = false;
		if (this.picture._alpha<100-this.fadeInSpeed) {
			this.picture._alpha += this.fadeInSpeed;
		}
	}
};
p = 0;
function nextImage() {
	if (p<(total-1)) {
		p++;
		if (loaded == filesize) {
			picture._alpha = 0;
			picture.loadMovie(image[p], 1);
			slideshow();
		}
	}
}
function firstImage() {
	if (loaded == filesize) {
		picture._alpha = 0;
		picture.loadMovie(image[0], 1);
		slideshow();
	}
}
function slideshow() {
	pauseInterval = setInterval(pause_slideshow, pauseDelay);
	function pause_slideshow() {
		clearInterval(pauseInterval);
		if (p == (total-1)) {
			p = 0;
			firstImage();
		} else {
			nextImage();
		}
	}
}
/*
MovieClip.prototype.fadeOut = function() {
	if (this.picture._alpha>this.fadeOutSpeed) {
		this.picture._alpha -= this.fadeOutSpeed;
	} else {
		nextImage();
	}
};
*/


I got the prototypes for the fade in and fade out from another script on Kirupa and managed to succesfuly merge the fade in into the onEnterFrame function, but I am lost with the fade out, I’ve tried many different things but for the life of me have no idea where or how the fade out function should be.

Any help will be much appreciated, I know there is a guru or two here that could point me in the right direction in 2 seconds ;).

Cheers.