# Looping Rhamej xml gallery/slideshow

**URL:** <https://forum.kirupa.com/t/looping-rhamej-xml-gallery-slideshow/281513>\
**Category:** Uncategorized\
**Created:** [February 10, 2009, 5:03am UTC](https://forum.kirupa.com/t/looping-rhamej-xml-gallery-slideshow/281513 "2009-02-10T05:03:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![max999](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@max999](https://forum.kirupa.com/u/max999)\
**Post date:** [February 10, 2009, 5:03am UTC](https://forum.kirupa.com/t/looping-rhamej-xml-gallery-slideshow/281513/1 "2009-02-10T05:03:23Z")

</div>

I would like to make the xml thumbnails loop from the last photo to the first photo (when pressing the Next button while viewing the last image) and also do the same for the prev button.  
It is for the thumbnails scroller, this is the code:  
//button actions  
scroller.nextBtn.onRelease = function() {  
var m:Number = pictures.length;  
var buts:MovieClip = scroller.container[“thumb”+(m-1)];  
if (clickCount\<howMclick) {  
clickCount++;  
frwrd = true;  
slideMain();  
}  
};  
scroller.prevBtn.onRelease = function() {  
var buts:MovieClip = scroller.container[“thumb”+0];  
if (clickCount != 0) {  
clickCount–;  
frwrd = false;  
slideMain();  
}  
};  
I’ ve tried everything but i can’t find the solution.  
Thanks a lot  
Max
