# How do i add scrolling thumbs to this XML auto play gallery?

**URL:** https://forum.kirupa.com/t/how-do-i-add-scrolling-thumbs-to-this-xml-auto-play-gallery/274767
**Category:** flash
**Created:** [November 4, 2008, 2:06pm UTC](https://forum.kirupa.com/t/how-do-i-add-scrolling-thumbs-to-this-xml-auto-play-gallery/274767 "2008-11-04T14:06:50Z")
**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: [November 4, 2008, 2:06pm UTC](https://forum.kirupa.com/t/how-do-i-add-scrolling-thumbs-to-this-xml-auto-play-gallery/274767/1 "2008-11-04T14:06:50Z")

</div>

Hi guys i have this xml photogallery that plays automatically and has a next pause play and prev button, also has a counter and dynamic txt, and i wanted to add scrolling thumbs(loaded from an xml gallery) to this…how do i do it? It’s probably very simple but i need help because i don’t get it.  
this is the link to the fla:

> **[XML photogallery AS question](https://www.kirupa.com/forum/showthread.php?t=310854)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

  
Thank You  
This is the code:

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, 70);  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“portfolio.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, 2500);  
}  
delete this.onEnterFrame;  
}  
};  
}  
MovieClip.prototype.fadeIn = function() {  
if (this.\_alpha\<100) {  
current.\_alpha -= 10;  
this.\_alpha += 10;  
} 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();  
}  
function prevImage() {  
p\>0 ? p-- : p=total-1;  
desc\_txt.text = description[p];  
picture\_num();  
preloadPic();  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / "+total;  
}  
previous\_btn.onRelease = function() {  
slide = 0;  
prevImage();  
};  
next\_btn.onRelease = function() {  
slide = 0;  
nextImage();  
};  
play\_btn.onRelease = function() {  
slide = 1;  
nextImage();  
};  
pause\_btn.onRelease = function() {  
slide = 0;  
clearInterval(id);  
};  
preloadPic();
