# Urgent help please xml gallery

**URL:** <https://forum.kirupa.com/t/urgent-help-please-xml-gallery/177532>\
**Category:** Uncategorized\
**Created:** [February 2, 2006, 7:02pm UTC](https://forum.kirupa.com/t/urgent-help-please-xml-gallery/177532 "2006-02-02T19:02:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![modji](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/modji/32/2117_2.png) [@modji](https://forum.kirupa.com/u/modji)\
**Post date:** [February 2, 2006, 7:02pm UTC](https://forum.kirupa.com/t/urgent-help-please-xml-gallery/177532/1 "2006-02-02T19:02:58Z")

</div>

Anyone has any idea how I can make the thumbnails scroll. They set up in 3X3. Thanks.

var tnNr;  
spacing = 10;  
container.\_alpha = 0;  
p = 0;  
var curLength;  
MovieClip.prototype.loadPic = function(pic) {  
container.\_alpha = 0;  
this.loadMovie(pic);  
this.\_parent.onEnterFrame = function() {  
var t = container.getBytesTotal(), l = container.getBytesLoaded();  
per = Math.round((l/t)_100);  
if (t != 0 && Math.round(l/t) == 1 && container.\_width != 0) {  
var w = container.\_width+spacing, h = container.\_height+spacing;  
border.resizeMe(w, h);  
loadText.text = “”;  
delete this.\_parent.onEnterFrame;  
} else {  
 [//loadText.text](https://loadText.text) = per+" % loaded";  
loadText.text = “INSIDE”;  
}  
};  
};  
MovieClip.prototype.resizeMe = function(w, h, id) {  
var speed = 3;  
container.\_alpha = 0;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
container.\_x = this.\_x-this.\_width/2+spacing/2;  
container.\_y = this.\_y-this.\_height/2+spacing/2;  
info.\_y = Math.round(this.\_y+this.\_height/2+spacing/2);  
container.\_alpha += 5;  
if (container.\_alpha\>90) {  
info.text = id;  
container.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};  
function galleryChoice(q) {  
pArray = new Array();  
tArray = new Array();  
my\_xml = new XML();  
for (var j = 0; j\<curLength; j++) {  
this.th\_nav[“thmb”+j].removeMovieClip();  
}  
my\_xml.ignoreWhite = true;  
my\_xml.onLoad = function(loaded) {  
if (loaded) {  
gallery = this.firstChild.childNodes[q];  
curLength = gallery.childNodes.length;  
for (var i = 0; i\<gallery.childNodes.length; i++) {  
pArray.push(gallery.childNodes_.attributes.source);  
tArray.push(gallery.childNodes\*.attributes.thumb);  
}  
}  
delay = setInterval(makeButtons, 50);  
};  
my\_xml.load(“gallery.xml”);  
}  
function makeButtons() {  
tnNr = 0;  
clearInterval(delay);  
var scroll\_mc = this.createEmptyMovieClip(“scroll\_mc”,98);  
scroll\_mc.setMask(mask);  
for (var i = 0; i\<tArray.length; i++) {  
var thb = th\_nav.thmb.duplicateMovieClip(“thmb”+i, 1000+i);  
pages = Math.floor(i/9);  
//9 because of we have 3 rows and 3 columns  
//trace(pages);  
pageing = pages\*(3_56);  
//56 is the space and 3 the columns  
thb.id = i;  
thb.\_x = ((i%3)50);  
thb.\_y = Math.floor((i/3%3))50 +pageing;  
}  
loadButtons();  
if (pages\>0) {  
for (var i = 0; i\<=pages; i++) {  
//attach a button each page  
var pag = this.attachMovie(“page\_btn”, “page”+i, 99+i);  
//position of the button  
pag.\_x = 125+i50;  
pag.\_y = 350;  
//identifier for the button  
pag.id = i;  
trace(i);  
//button text  
pag.info.text = i+1;  
pag.onPress = function() {  
scroll\_mc.\_x = -(this.id(3_spacing));  
};  
}  
}  
}  
function loadButtons() {  
var tbox = th\_nav[“thmb”+tnNr].box;  
tbox.loadMovie(tArray[tnNr]);  
temp = this.createEmptyMovieClip(“tmp”+tnNr, 999);  
temp.onEnterFrame = function() {  
bt = tbox.getBytesTotal();  
bl = tbox.getBytesLoaded();  
if (bt == bl && bt\>4) {  
nextButton();  
delete this.onEnterFrame;  
}  
};  
}  
function nextButton() {  
if (tnNr\<tArray.length-1) {  
tnNr++;  
loadButtons();  
} else {  
activateButtons();  
}  
}  
function activateButtons() {  
for (var i = 0; i\<pArray.length; i++) {  
var but = th\_nav[“thmb”+i];  
but.id = i;  
but.onRelease = function() {  
container.loadPic(pArray[this.id], iArray[this.id]);  
disButtons2(this.id);  
p = this.id;  
};

```
}
container.loadPic(pArray[0], iArray[0]);
disButtons2(0);

```

}  
////////////////////////////////////////////  
/_listen = new Object();  
listen.onKeyDown = function() {  
if (Key.getCode() == Key.LEFT) {  
prevImage();  
} else if (Key.getCode() == Key.RIGHT) {  
nextImage();  
}  
};  
Key.addListener(listen);_/  
previous\_btn.onRelease = function() {  
prevImage();  
};  
next\_btn.onRelease = function() {  
nextImage();  
};  
function nextImage() {  
var bt = container.getBytesTotal();  
var bl = container.getBytesLoaded();  
if (p\<pArray.length-1) {  
//check to see if u are the at the last img or not  
p++;  
if (bl == bt) {  
container.\_alpha = 50;  
container.loadPic(pArray[p], 1);  
disButtons2§;  
}  
}  
picture\_num();  
}  
function prevImage() {  
if (p\>0) {  
p–;  
container.\_alpha = 0;  
container.loadPic(pArray[p], 1);  
disButtons2(this.p);  
picture\_num();  
}  
}  
function picture\_num() {  
current\_pos = p+1;  
//trace(current\_pos);  
}  
function thumbNailScroller() {  
// thumbnail code!  
this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 10;  
tscroller.onEnterFrame = function() {  
if ((\_root.\_ymouse\>=th\_nav.\_y) && (\_root.\_ymouse\<=th\_nav.\_y+th\_nav.\_height)) {  
if ((\_root.\_xmouse\>=(hit\_right.\_x-40)) && (th\_nav.hitTest(hit\_right))) {  
th\_nav.\_x -= scroll\_speed;  
} else if ((\_root.\_xmouse\<=(hit\_left.\_x+40)) && (th\_nav.hitTest(hit\_left))) {  
th\_nav.\_x += scroll\_speed;  
}  
} else {  
delete tscroller.onEnterFrame;  
}  
};  
}  
function setScroller() {  
//clear the interval  
clearInterval(delay);  
//if there are not enough thumbs, set the scroller invisible and the variable  
//in menu\_mc to 0 (see there)  
if (menu\_mc.box.\_height\<menu\_mc.mask.\_height) {  
menu\_mc.slide.\_visible = menu\_mc.dragger.\_visible=0;  
menu\_mc.vis = 0;  
} else {  
//there are enough thumbs, so the scroller is visible and we can scroll  
menu\_mc.slide.\_visible = menu\_mc.dragger.\_visible=1;  
menu\_mc.dragger.\_y = 1;  
menu\_mc.vis = 1;  
}  
}  
///////////////////////////////////////  
function disButtons2(d) {  
for (var i = 0; i\<tArray.length; i++) {  
if (i != d) {  
this.th\_nav[“thmb”+i].enabled = 1;  
this.th\_nav[“thmb”+i].box.\_alpha = 100;  
} else {  
this.th\_nav[“thmb”+i].enabled = 0;  
this.th\_nav[“thmb”+i].box.\_alpha = 50;  
}  
}  
}  
function disButtons(d) {  
for (var i = 0; i\<butArray.length; i++) {  
if (i != d) {  
this[butArray\*].enabled = 1;  
this[butArray\*].gotoAndStop(1);  
} else {  
this[butArray\*].enabled = 0;  
this[butArray\*].gotoAndStop(2);  
}  
}  
}  
disButtons(0);  
galleryChoice(0);

[URL=“[http://inside.pandela.net/2.zip](http://inside.pandela.net/2.zip)”]
