Need help editing actions! Please help!

Hi there,

I have the below code on a movie clip. Inside the movie clip are 5 frames, all with a different image.

The below syntax is set up to rotate 5 images at random but I need to add another and was wondering how should I edit the code to deal with 6 images instead of 5. Here it is:


onClipEvent (load) {
    delay = 7000;
    resetTime = getTimer()+delay;
}
onClipEvent (enterFrame) {
    if (getTimer()>resetTime) {
        resetTime = getTimer()+delay;
        this.gotoAndStop(random(5)+1);
    }
}

I tried just changing the 5 to 6 but the movie worked but then froze on an image.

Many thanks for your time and help!

Cheers,

Mark