Okay, so I did what I was supposed to do. I've looked through hundreds of posts for the answer to this. many come close to addressing/resolving my question but not dead on. I have the typical XML enabled photo gallery. I am using this format to display different themed galleries. So for example, one will be pictures from 2004, another from 2005 and so on. I want a button to load the appropriate .xml file and begin to display the images while still being able to use the same previous and next buttons that are already on the page. Can anyone help? I thought about assignign each gallery to it's own frame and having a 2004 button just go to the appropriate frame, but I am trying to really make this dynamic. Any help would greatly be appreciated. Below is the code I have so far. Thanks in advance!



function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
//declare image and description as array
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content.text = "file not loaded!";
}
}
xmlAlbum = new XML();
xmlAlbum.ignoreWhite = true;
xmlAlbum.onLoad = loadXML;
xmlAlbum.load("images.xml");
//////////////////////////////////////////////
p = 0;
function nextImage() {
if (p<(total-1)) {
p++;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
photo_mc.loadPhoto(image[0]);
desc_txt.text = description[p];
picture_num();
}
///////////////////////////////////////////////
var SPACING = 10
photo_mc._alpha = 0;
MovieClip.prototype.loadPhoto = function(photo) {
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function() {
// modified the total and loaded so as to round it up
// to smaller number.
var total = photo_mc.getBytesTotal();
var loaded =photo_mc.getBytesLoaded();
if (total != 0 && Math.round(total/loaded) == 1 && photo_mc._width>0)
{
var w = photo_mc._width+SPACING, h = photo_mc._height+SPACING;
border.resize(w, h, pic);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resize = function(w, h, pic)
{
//the higher the slower the resize of the border
var speed = 2;
photo_mc._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;
photo_mc._x = this._x-this._width/2+SPACING/2;
photo_mc._y = this._y-this._height/2+SPACING/2;
photo_mc._alpha += 20;
if (photo_mc._alpha>90)
{
photo_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};

function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
if (p == 0) {
previous_btn._alpha = 100;
previous_btn.enabled = true;
} else {
previous_btn._alpha = 100;
previous_btn.enabled = false;
}
if (p == (total-1)) {
next_btn._alpha = 50;
next_btn.enabled = false;
} else {
next_btn._alpha = 100;
next_btn.enabled = true;
}