I know this question has been asked before, but in my search of the tues and boards I didn't see anything that could help without rewriting all of my code, so I thought I'd ask first to see if there was an easy fix.

I have a picture slideshow set to a button, that loads and shuffles an array of external .swfs into two MC holders and shows a fade transition between pics when the button is pressed. I'd like to remove the button script and replace it with a timed function that advances to the next swf after an amount of time has elapsed (say 30 seconds). Can someone help me modify my code? I haven't used timed events before.

code:

swfArray = new Array("pic1.swf", "pic2.swf", "pic3.swf");

Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar+1);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
ASSetPropFlags(Array.prototype, "shuffle", 1);

swfArray.shuffle();

this.createEmptyMovieClip("target1",1)
this.createEmptyMovieClip("target2",2)

target1.loadMovie(swfArray[0]);

activeTarget = target1;
currentIndex = 0;

this.onEnterFrame = function() {
currentIndex++;
if(currentIndex>=swfArray.length) {
currentIndex=0;
swfArray.shuffle();
}
target1.loadMovie(swfArray[0]);
}

target2._alpha = 0;

this.onEnterFrame = function() {
if (obj1._alpha > 0) {
obj1._alpha -= 10;
}
if (obj2._alpha < 100) {
obj2._alpha += 10;
}
};

//button script that swaps load target focus and loads the next movie
nextButton.onRelease = function() {
if (activeTarget == target1) {
obj1 = target1;
obj2 = activeTarget = target2;
} else {
obj1 = target2;
obj2 = activeTarget = target1;
}

currentIndex++;
if(currentIndex>=swfArray.length) {
currentIndex=0;
swfArray.shuffle();
}
this.loadMovie(swfArray[0]);

obj2.loadMovie(swfArray[currentIndex])

obj1.onEnterFrame = function () {
if (this._alpha <=0 ) {
this.unloadMovie();
delete this.onEnterFrame;
}
}
};



Any help is appreciated!

-Sandy