Random movie playback?

Hi,

I’ve previously made a movie file that contained several other movies and added this code to it to enable the user to press it and have a random movie playback etc:

on(rollover){
frame = Math.floor(Math.random()*this._totalframes)+1;
this.gotoAndStop(frame);
}

However now I would like the same to happen but that there is no need for the user to press the movie… it just plays back random movies within itself (I hope your still following?).

Any ideas… the piece of coding above requires a on(…) function

Can I use a pause for so many seconds function etc?

Thanks

Spence