# Simple slideshow help?

**URL:** https://forum.kirupa.com/t/simple-slideshow-help/290152
**Category:** flash
**Created:** [June 10, 2009, 1:35pm UTC](https://forum.kirupa.com/t/simple-slideshow-help/290152 "2009-06-10T13:35:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ricoo](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Ricoo](https://forum.kirupa.com/u/Ricoo)
#### Post date: [June 10, 2009, 1:35pm UTC](https://forum.kirupa.com/t/simple-slideshow-help/290152/1 "2009-06-10T13:35:14Z")

</div>

Hy, I’m trying to create mono slide show, but I managed to be in some strange trouble. Namely mono slide show works nice, but something is wrong or missing in the code, because it puts the picture, that is pulled thru xml on top of everything. One solution is to do picture smaller, but i want to have buttons and info on the picture. It is not layer problem, because layer with picture container is on the last one. Heres the code:

```auto
var id, current;
var k = 0, p = 0;
var slide = 0;
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		image = [];
		description = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
			description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
		}
		id = setInterval(preloadPic, 70);
	} else {
		content = "file not loaded!";
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("portfolio.xml");
function preloadPic() {
	clearInterval(id);
	var con = picture.duplicateMovieClip("con"+k, 9984+k);
	con.loadMovie(image[p]);
	preloader._visible = 1;
	preloader.swapDepths(con.getDepth()+3);
	con._alpha = 0;
	var temp = _root.createEmptyMovieClip("temp"+k, 99+k);
	k++;
	temp.onEnterFrame = function() {
		var total = con.getBytesTotal();
		var loaded = con.getBytesLoaded();
		percent = Math.round(loaded/total*100);
		preloader.preload_bar._xscale = percent;
		if (con._width) {
			preloader._visible = 0;
			con.onEnterFrame = fadeIn;
			if (slide) {
				id = setInterval(nextImage, 2500);
			}
			delete this.onEnterFrame;
		}
	};
}
MovieClip.prototype.fadeIn = function() {
	if (this._alpha<100) {
		current._alpha -= 10;
		this._alpha += 10;
	} else {
		current._visible = 0;
		current = this;
		delete this.onEnterFrame;
	}
};
function nextImage() {
	p<total-1 ? p++ : p=0;
	desc_txt.text = description[p];
	picture_num();
	preloadPic();
}
function prevImage() {
	p>0 ? p-- : p=total-1;
	desc_txt.text = description[p];
	picture_num();
	preloadPic();
}
function picture_num() {
	current_pos = p+1;
	pos_txt.text = current_pos+" / "+total;
}
previous_btn.onRelease = function() {
	slide = 0;
	prevImage();
};
next_btn.onRelease = function() {
	slide = 0;
	nextImage();
};
play_btn.onRelease = function() {
	slide = 1;
	nextImage();
};
pause_btn.onRelease = function() {
	slide = 0;
	clearInterval(id);
};
preloadPic();

```
