# Photo Gallery Using XML and Flash

**URL:** <https://forum.kirupa.com/t/photo-gallery-using-xml-and-flash/176818>\
**Category:** Uncategorized\
**Created:** [January 27, 2006, 5:36am UTC](https://forum.kirupa.com/t/photo-gallery-using-xml-and-flash/176818 "2006-01-27T05:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCampos021](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@JCampos021](https://forum.kirupa.com/u/JCampos021)\
**Post date:** [January 27, 2006, 5:36am UTC](https://forum.kirupa.com/t/photo-gallery-using-xml-and-flash/176818/1 "2006-01-27T05:36:24Z")

</div>

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…

```auto

 
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
