Hi,
I went through a list of post discussing different modifications to the slideshow and photo gallery tutorials but i didn’t read of anyone trying to combine slideshow and photo gallery functionality. The slideshow is driven by an onEnterFrame and loops through how ever many number of images (nodes in the xml) and then displays them automatically…but the photo gallery script advances (prev or next) based on onRelease events of the key press or click of the buttons.
However, I was trying to combine both and noticed immediately that while in the onEnterFrame …if pressing the next button a couple of times…the count gets messed up and the slideshow advances really quickly for however many number of times you have clicked (prev or next)…if once…you may not notice…but if twice…(i.e. on 2 and clicking twice to 4…then it jumps to 6…then 8…etc…)…for larger sequences of clicks…you notice…4…8…12…16…
I was wondering what would be a good fix for this…
considering both prevImage() and nextImage() functions determine how p is controlled before calling the slideshow() function?
//nextImage function
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
}
}
//Slideshow function
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}