# XML Gallery

**URL:** <https://forum.kirupa.com/t/xml-gallery/177230>\
**Category:** flash\
**Created:** [January 31, 2006, 6:42am UTC](https://forum.kirupa.com/t/xml-gallery/177230 "2006-01-31T06:42:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Multi\_Task](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Multi\_Task](https://forum.kirupa.com/u/Multi_Task)\
**Post date:** [January 31, 2006, 6:42am UTC](https://forum.kirupa.com/t/xml-gallery/177230/1 "2006-01-31T06:42:51Z")

</div>

I am using a XML gallery slideshow and on the next and prev. buttons I would like them when they are either at the end or at the begining to go to the one before and keep looping instead of stopping.  
What do I need to change on my next or prevs?

function nextImage() {  
if (p\<(total-1)) {  
p++;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
picture\_num();  
slideshow();  
}  
}  
}  
function prevImage() {  
if (p\>0) {  
p–;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
picture\_num();  
}  
}  
}  
Any help is gladly appreciated. This is from the tutorials slideshow.
