Hello, I made the photo gallery using the tutorial on this site the other day, but i wanted to use buttons to sort through the pictures instead of using the previous and next buttons. So i have five pictures and made 5 buttons. for some reason its not working. i was wondering if anyone had any ideas what i could do…
Here is the code i used…
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
headline = [];
blurb = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
headline* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
blurb* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
[\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\](http://www.kirupa.com/forum/)
listen = new Object();
Key.addListener(listen);
first_btn.onRelease = function() {
firstImage();
};
second_btn.onRelease = function() {
secondImage();
};
third_btn.onRelease = function() {
thirdImage();
};
fourth_btn.onRelease = function() {
fourthImage();
};
fifth_btn.onRelease = function() {
fifthImage();
};
[\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\](http://www.kirupa.com/forum/)
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
blurb_txt.text = blurb[0];
picture_num();
}
}
function secondImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[1], 1);
desc_txt.text = headline[1];
blurb_txt.text = blurb[1];
picture_num();
}
}
function thirdImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[2], 1);
desc_txt.text = description[2];
blurb_txt.text = blurb[2];
picture_num();
}
}
function fourthImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[3], 1);
desc_txt.text = description[3];
blurb_txt.text = blurb[3];
picture_num();
}
}
function fifthImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[4], 1);
desc_txt.text = description[4];
blurb_txt.text = blurb[4];
picture_num();
}
}
Thanks in advance for your help