XML Gallery question...adding 'on' states to buttons

Hi Everyone,
I’m using the xml gallery tutorial, V3 with thumbs, and have modified it to use buttons called to in the AS, and load the images from there. What I’m trying to include in the code is for the button_mc’s to stay ‘on’ when they are clicked, and when another one in the group is clicked, have that one stay on, while the others are ‘off.’ Here’s the AS for the gallery with the button as in it.

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
title = [];
description = [];
thumbnails = [];
links = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
title* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
links* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“web.xml”);
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
_root.adContent.web.previous_btn.onRelease = function() {
prevImage();
};
_root.adContent.web.next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = _root.adContent.web.picture.getBytesTotal();
loaded = _root.adContent.web.picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
_root.adContent.web.preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
_root.adContent.web.preloader._visible = false;
picture.onRelease = function() {
getURL(links[p], “_blank”);
};
_root.adContent.web.link.onRelease = function() {
getURL(links[p], “_blank”);
};
if (_root.adContent.web.picture._alpha<100) {
_root.adContent.web.picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
_root.adContent.web.picture._alpha = 0;
_root.adContent.web.picture.loadMovie(image[p], 1);
_root.adContent.web.title_txt.text = title[p];
_root.adContent.web.desc_txt.text = description[p];
_root.adContent.web.link_txt.text = links[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p–;
_root.adContent.web.picture._alpha = 0;
_root.adContent.web.picture.loadMovie(image[p], 1);
_root.adContent.web.title_txt.text = title[p];
_root.adContent.web.desc_txt.text = description[p];
_root.adContent.web.link_txt.text = links[p];
picture_num();
}
}
function firstImage() {
_root.adContent.web.picture._alpha = 0;
_root.adContent.web.picture.loadMovie(image[p]);
_root.adContent.web.title_txt.text = title[p];
_root.adContent.web.desc_txt.text = description[p];
_root.adContent.web.link_txt.text = links[p];
picture_num();
}
_root.adContent.web.sl1.btn1.onRelease = function() {
p = 0;
firstImage();
};

_root.adContent.web.sl1.btn2.onRelease = function() {
p = 1;
firstImage();
};

_root.adContent.web.sl1.btn3.onRelease = function() {
p = 2;
firstImage();
}

_root.adContent.web.sl1.btn4.onRelease = function() {
p = 3;
firstImage();
}

_root.adContent.web.sl1.btn5.onRelease = function() {
p = 4;
firstImage();
}

_root.adContent.web.sl1.btn6.onRelease = function() {
p = 5;
firstImage();
}

_root.adContent.web.sl1.btn7.onRelease = function() {
p = 6;
firstImage();
}

_root.adContent.web.sl1.btn8.onRelease = function() {
p = 7;
firstImage();
}

_root.adContent.web.sl1.btn9.onRelease = function() {
p = 8;
firstImage();
}

_root.adContent.web.sl1.btn10.onRelease = function() {
p = 9;
firstImage();
}

_root.adContent.web.sl1.btn11.onRelease = function() {
p = 10;
firstImage();
}

_root.adContent.web.sl1.btn12.onRelease = function() {
p = 11;
firstImage();
}

_root.adContent.web.sl1.btn13.onRelease = function() {
p = 12;
firstImage();
}

_root.adContent.web.sl1.btn14.onRelease = function() {
p = 13;
firstImage();
}

_root.adContent.web.sl1.btn15.onRelease = function() {
p = 14;
firstImage();
}

_root.adContent.web.sl1.btn16.onRelease = function() {
p = 15;
firstImage();
}

_root.adContent.web.sl1.btn17.onRelease = function() {
p = 16;
firstImage();
}

_root.adContent.web.sl1.btn18.onRelease = function() {
p = 17;
firstImage();
}

_root.adContent.web.sl1.btn19.onRelease = function() {
p = 18;
firstImage();
}

_root.adContent.web.sl1.btn20.onRelease = function() {
p = 19;
firstImage();
}

_root.adContent.web.sl1.btn21.onRelease = function() {
p = 20;
firstImage();
}

_root.adContent.web.sl1.btn22.onRelease = function() {
p = 21;
firstImage();
}

_root.adContent.web.sl1.btn23.onRelease = function() {
p = 22;
firstImage();
}

_root.adContent.web.sl1.btn24.onRelease = function() {
p = 23;
firstImage();
}

_root.adContent.web.sl1.btn25.onRelease = function() {
p = 24;
firstImage();
}

_root.adContent.web.sl1.btn26.onRelease = function() {
p = 25;
firstImage();
}

_root.adContent.web.sl1.btn27.onRelease = function() {
p = 26;
firstImage();
}

_root.adContent.web.sl1.btn28.onRelease = function() {
p = 27;
firstImage();
}

_root.adContent.web.sl1.btn29.onRelease = function() {
p = 28;
firstImage();
}

_root.adContent.web.sl1.btn30.onRelease = function() {
p = 29;
firstImage();
}

_root.adContent.web.sl1.btn31.onRelease = function() {
p = 30;
firstImage();
}
_root.adContent.web.sl1.btn32.onRelease = function() {
p = 31;
firstImage();
}

function picture_num() {
current_pos = p+1;
_root.adContent.web.pos_txt.text = current_pos+" / "+total;
}

Here’s a link. the first two galleries are working.
http://www.unlv.edu/webstaff/kelleher/projects/mprFlash/index.html

I’ll post the fla if you think you can help.
:frowning: