XML auto crossfading gallery..stop looping after one round?

I have this code for an auto slideshow(supposed to be with thumbs but i am not using them), how do i stop from looping after all the pics run once?
Thanks a lot
Code:
var delay:Number = 2500;
var init:Boolean = false;

var top:MovieClip = picture;
var bot:MovieClip = picture2;

//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images.xml”);
p = 0;

function fadeIn() {
//swap();
onEnterFrame = function() {
filesize = top.getBytesTotal();
loaded = top.getBytesLoaded();
if (loaded != filesize) {
preloader._visible = true;
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (top._alpha < 100) {
top._alpha +=5;
}else{
delete onEnterFrame;
slideshow();
}
}
};
};

function fadeOut() {
onEnterFrame = function() {
if (top._alpha > 5) {
top._alpha -=5;
}else{
top._alpha = 0;
delete onEnterFrame;
nextImage();
}
};
};

function nextImage() {
if (p<(total-1)) {
p++;
top._alpha = 0;
top.loadMovie(image[p]);
desc_txt.text = description[p];
picture_num();
fadeIn();
}
};

function firstImage() {
init = true;
top._alpha = 0;
top.loadMovie(image[0]);
desc_txt.text = description[0];
picture_num();
fadeIn();
};

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

function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1) && !init) {
p = 0;
firstImage();
} else if (p == (total-1) && init) {
p = -1;
swap();
}else{
swap();
}
}
};

function swap(){
var t = top;
top.swapDepths(bot);
top = bot;
bot = t;
nextImage();
}