Hi,
I have photo galleries loading via an xml file.
Right now, it stops at the last photo. I would like it to “loop” back to the first photo instead of stopping and vice versa for the previous button.
Here is my code for next and previous buttons.
Thanks!
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 20;
picture.contentPath = image[p];
picture_num();
if(!auto_dsbl){
slideshow();
}
}
}
}
function prevImage() {
if (p>0) {
p–;
picture._alpha = 20;
picture.contentPath = image[p];
picture_num();
}
}