Flash 8 XML Slideshow Help!

Hello,

I have a slideshow that I had purchased as a template but I would like to add a slideshow function to it. Right now, it is pulling from an xml file and you can only click “next”, “previous” or on the thumbnails to view the photos. I would also like the “next” and “previous” buttons to be outside of the image. I am new to actionscript so I am having trouble writing the function that will display the images as a slideshow. I have included the code below.

Here is the code on the first frame inside the gallery_mc movieclip:

stageW = 800;
stageH = 600;
bgX = bg._x;
bgY = bg._y;
menu_mc.bgX = menu_mc.bg._x;
menu_mcX = menu_mc._x;
menu_mcY = menu_mc._y;
stageListener = new Object();
Stage.addListener(stageListener);
alignObjects = function () {
bg._x = bgX-(Stage.width-stageW)/2;
bg._y = bgY-(Stage.height-stageH)/2;
bg._width = Stage.width;
bg._height = Stage.height;
menu_mc._x = 0.0;
menu_mc._y = -225.0;
menu_mc.bg._x = menu_mc.bgX-(Stage.width-stageW)/2;
menu_mc.bg._width = Stage.width;
};
stageListener.onResize = function() {
alignObjects();
};
alignObjects();
//Load XML Data
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
colour = [];
thumb = [];
copy_txt = []
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
colour* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumb* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
copy_txt* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
gotoAndStop(2);
}
} else {
msg.text = “Error loading XML”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“content.xml”);
stop();

Here is the code on teh second frame in the gallery_mc movieclip:

////////////Initial Settings////////////
//Set border size here
border = 15;
//Set your stage width & height here
stageW = 800;
stageH = 600;
//Set initial size of white block on first image load here
bg_mc.bg._width = 200;
bg_mc.bg._height = 200;
//Set number of thumbs to be displayed
minThumbs = 15;
//Set spacing between thumbs
thumbSpacing = 6;
////////////Initial Values////////////
page = 0;
info_mc._alpha = 0;
info_mc.destAlpha = 0;
bttnNext._visible = false;
bttnPrev._visible = false;
info_bttn._visible = false;
////////////Functions: Buttons/////////////
bg_mc.bg.bttnNext.onRelease = function() {
nextPage();
};
bg_mc.bg.bttnNext.onRollOver = function() {
bttnNext._visible = true;
};
bg_mc.bg.bttnNext.onRollOut = function() {
bttnNext._visible = false;
};
bg_mc.bg.bttnNext.onDragOut = function() {
bttnNext._visible = false;
};
bg_mc.bg.bttnPrev.onRelease = function() {
prevPage();
};
bg_mc.bg.bttnPrev.onRollOver = function() {
bttnPrev._visible = true;
};
bg_mc.bg.bttnPrev.onRollOut = function() {
bttnPrev._visible = false;
};
bg_mc.bg.bttnPrev.onDragOut = function() {
bttnPrev._visible = false;
};
info_bttn.bttn.onRollOver = function() {
info_mc.destAlpha = 100;
};
info_bttn.bttn.onRollOut = function() {
info_mc.destAlpha = 0;
};
info_bttn.bttn.onDragOut = function() {
info_mc.destAlpha = 0;
};
////////////Functions: Page Navigation/////////////
function nextPage() {
if (page<(total-1)) {
if (this.menu_mc.thumb_menu._x>this.menu_mc.thumb_menu.destX-0.5 && this.menu_mc.thumb_menu._x<this.menu_mc.thumb_menu.destX+0.5) {
if (this.menu_mc.thumb_menu._x>(this.menu_mc.thumb_menu.originX-(this.menu_mc.thumb_menu._width-(this.menu_mc.thumb_menu.thumb_mc._width+thumbSpacing)(minThumbs+1))-5)) {
this.menu_mc.thumb_menu.destX -= (this.menu_mc.thumb_menu.thumb_mc._width+thumbSpacing);
}
holder._alpha = -100;
info_mc._alpha = 0;
page++;
loadMovie(image[page], holder);
pageNum();
}
}
}
function prevPage() {
if (page>0) {
if (this.menu_mc.thumb_menu._x>this.menu_mc.thumb_menu.destX-0.5 && this.menu_mc.thumb_menu._x<this.menu_mc.thumb_menu.destX+0.5) {
if (this.menu_mc.thumb_menu._x<this.menu_mc.thumb_menu.originX-5) {
this.menu_mc.thumb_menu.destX += (this.menu_mc.thumb_menu.thumb_mc._width+thumbSpacing);
}
holder._alpha = -100;
info_mc._alpha = 0;
page–;
loadMovie(image[page], holder);
pageNum();
}
}
}
function firstPage() {
holder._alpha = -100;
info_mc._alpha = 0;
loadMovie(image[page], holder);
pageNum();
}
function pageNum() {
bg.newHEX = colour[page];
info_mc.txt.text = copy_txt[page];
}
_global.thumbClick = function(object) {
page = object.ID;
holder._alpha = -100;
loadMovie(image[page], holder);
pageNum();
};
firstPage();
alignPic();
////////////Alignment of objects on stage resize////////////
function alignPic() {
destWidth = holder._width;
destHeight = holder._height;
holder._x = (stageW-holder._width)/2;
holder._y = (stageH-holder._height-menu_mc._height)/2;
bg_mc.bg._width += (destWidth+border-bg_mc.bg._width)/5;
bg_mc.bg._height += (destHeight+border-bg_mc.bg._height)/5;
bg_mc.bg._x = holder._x;
bg_mc.bg._y = holder._y;
bg_mc._x = holder._width/2;
bg_mc._y = holder._height/2;
bttnNext._y = holder._y+(holder._height-bttnNext._height)/2;
bttnNext._x = bg_mc._width+(stageW-bg_mc._width)/2-bttnNext._width-border/2;
bttnPrev._y = holder._y+(holder._height-bttnPrev._height)/2;
bttnPrev._x = (stageW-bg_mc._width)/2+bttnPrev._width+border/2;
preloader._x = holder._x+holder._width/2;
preloader._y = holder._y+holder._height/2;
info_bttn._x = preloader._x;
info_bttn._y = preloader._y;
info_mc._x = preloader._x;
info_mc._y = holder._y+holder._height;
info_mc.bg._width = holder._width;
info_mc.txt._width = info_mc.bg._width;
info_mc.txt._x = info_mc.bg._x-info_mc.bg._width/2;
}
////////////Build Image Gallery based on XML Data////////////
for (i=0; i<total; ++i) {
this.menu_mc.thumb_menu.thumb_mc.duplicateMovieClip(“thumb_mc”+i, i);
this.menu_mc.thumb_menu.thumb_mc._visible = false;
this.menu_mc.thumb_menu[“thumb_mc”+i].ID = i;
this.menu_mc.thumb_menu[“thumb_mc”+i]._x = (this.menu_mc.thumb_menu.thumb_mc._width+thumbSpacing)i;
this.menu_mc.thumb_menu[“thumb_mc”+i].holder.loadMovie(thumb
);
this.menu_mc.thumb_menu[“thumb_mc”+i].txt = txt
;
this.menu_mc.thumb_menu[“thumb_mc”+i].destX = this.menu_mc.thumb_menu[“thumb_mc”+i]._x;
this.menu_mc.thumb_menu[“thumb_mc”+i]._alpha = 0;
this.menu_mc.thumb_menu._x = this.menu_mc.thumb_menu.originX=(stageW-(this.menu_mc.thumb_menu.thumb_mc._width+thumbSpacing)*minThumbs)/2;
this.menu_mc.mask_mc._width = (this.menu_mc.thumb_menu.thumb_mc._width+thumbSpacing)*minThumbs;
this.menu_mc.mask_mc._x = this.menu_mc.thumb_menu._x;
this.menu_mc.bttnPrev._x = this.menu_mc.mask_mc._x-thumbSpacing;
this.menu_mc.bttnNext._x = this.menu_mc.mask_mc._x+this.menu_mc.mask_mc._width;
this.menu_mc.thumb_menu[“thumb_mc”+i].onEnterFrame = function() {
if (page == this.ID) {
this.gotoAndStop(21);
} else {
if (this._currentframe == 21) {
this.play();
}
}
if (this.isLoaded && this._alpha<100) {
this._alpha += 10;
}
};
}
////////////Thumnail menu and preloader script////////////
this.menu_mc.thumb_menu.destX = this.menu_mc.thumb_menu._x;
onEnterFrame = function () {
this.menu_mc.thumb_menu._x += (this.menu_mc.thumb_menu.destX-this.menu_mc.thumb_menu._x)/3;
loaded = holder.getBytesLoaded();
filesize = holder.getBytesTotal();
if (filesize>100) {
percentage = Math.round((loaded/filesize)*100);
preloader.percentageTxt = percentage;
if (isNaN(percentage) or percentage == 0) {
percentage = 0;
preloader.left.half._rotation = 0;
preloader.right.half._rotation = 0;
picLoaded = false;
} else if (percentage<=50 && percentage>0) {
preloader.left.half._rotation = 0;
preloader.right.half._rotation = (360/100)percentage;
picLoaded = false;
} else if (percentage>50 && percentage<100) {
preloader.left.half._rotation = (360/100)
(percentage-50);
preloader.right.half._rotation = 180;
picLoaded = false;
} else if (filesize == loaded) {
info_bttn._visible = true;
preloader.left.half._rotation = 180;
preloader.right.half._rotation = 180;
alignPic();
if (bg_mc.bg._width>destWidth) {
info_mc._alpha += (info_mc.destAlpha-info_mc._alpha)/5;
if (holder._alpha<100) {
holder._alpha += 5;
}
} else {
info_mc._alpha = 0;
info_mc._destAlpha = 0;
}
}
}
};
stop();

I just need to add a function that will loop through the xml file and automatically start the slideshow onLoad. Any help would be great!

Thank you.