Random frame/image selections

In the 3rd frame of my main timline, lies a MC, in the MC is a code:

onClipEvent (load) {
this.gotoAndStop (Math.ceil (Math.random() * this._totalframes))
}

In the MC, there is as well 5 frames, with diffrent images in each. It used to work fine. Everytime it reloaded, a diffrent image would appear. Now I put a pre loader and shift the whole animation 3 frames up, and now it goes psycho rave on me, and dosent changing.

Thanks for the help!

here is the .fla :http://www.pacific-emarket.com/special_olympics/v4.0/html/test.rar
And here is the example of it going crazy: http://www.pacific-emarket.com/special_olympics/v4.0/html/volunteers.htm
Thanks again!

i can’t run rar files, but try this:

onClipEvent (load) {
this.gotoAndStop (Math.ceil (Math.random() * this._totalframes)+3)
}

On frame 3 of main timeline:[AS]stop();


Now selecy your mc with the pictures.
Place the folllowing code:
[AS]onClipEvent (load) {
        this.gotoAndStop (Math.floor(Math.random() *this._totalframes)+1)
}
[/AS]

Work great, thanks alot guys!

welcome :slight_smile: