Flash XML Gallery - auto cycle?

Hi Guys, first off I have to say how helpful this forum has been. A great place to learn!

Anyway, I have used the Flash XML Gallery ideas put forth and so far it works great. It loads the images and dynamically resizes the borders - repositions my next and previous buttons - just great.

Now I want to modify things so that as well as being able to click the ‘next’ button to load the next image, I also want it to automatically cycle through the images even if the nav buttons haven’t been clicked. So if the user hasn’t clicked ‘next’ within 10 seconds, it automatically cycles through to the next image.

Unfortunately I’m at a bit of a loss where to start! My code is below:

stop();
spacing = 10;
containerMC._alpha = 0;
var pArray = new Array();
var tArray = new Array();
var cur;
MovieClip.prototype.loadPic = function(pic) {
cur = pic;
this._alpha = 0;
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (l == t && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
bar._visible = 0;
containerMC._alpha = 0;
picinfo.info.text = tArray[pic];
delete this.onEnterFrame;
} else {
bar._width = per;
//gives the bar a max width 100 
picinfo.info.text = per+" % loaded";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2)+700;
shadowFollow();
prevb._x = nav._x+35;
nextb._x = nav._x+this._width-40;
nextb._y = prevb._y=this._y+this._height/2-15;
picinfo._y = this._y-this._height/2+25;
picinfo._x = this._x-picinfo._width/2;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
trace(gallery.childNodes.length)
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes*.attributes.title);
pArray.push(gallery.childNodes*.attributes.source);
}
containerMC.loadPic(0);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("gallery.xml");
prevb.onRelease = function() {
cur--;
if (cur<0) {
containerMC.loadPic(pArray.length-1);
} else {
containerMC.loadPic(cur);
}
};
nextb.onRelease = function() {
cur++;
if (cur > pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur);
}
};
function shadowFollow() {
shad_bl._y = shad_b._y=shad_br._y=border._y+border._height/2;
shad_bl._x = border._x-border._width/2+shad_bl._width;
shad_b._x = shad_bl._x;
shad_r._x = shad_br._x=shad_tr._x=border._x+border._width/2;
shad_tr._y = border._y-border._height/2+shad_tr._height;
shad_r._y = shad_br._y;
shad_b._xscale = shad_br._x-shad_bl._x;
shad_r._xscale = shad_br._y-shad_tr._y;
}

Any help would be really appreciated!