Hi, please can anyone help me with this… slide show.
:stare: it looks like the problem is that the interval has not been clear so every time i click away from my slide show (for example navigate to my contact swf) and then come back to the slide show the pictures keep looping on top of each other and fading at the wrong times too.
Does anyone know how to do it?
Ill preciate any help… couse my face starts looking like this :stare:…
this is the code, from one of the kirupa tutorials.
var id, current;
var k = 0, p = 0;
var slide = 1;
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, 100);
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images/galeria/slides/galeria.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, 5000);
}
delete this.onEnterFrame;
}
};
}
MovieClip.prototype.fadeIn = function() {
if (this._alpha<100) {
current._alpha -= 4;
this._alpha += 4;
} 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();
}
preloadPic();