# Random frame/image selections

**URL:** <https://forum.kirupa.com/t/random-frame-image-selections/27233>\
**Category:** flash\
**Created:** [July 31, 2003, 10:00am UTC](https://forum.kirupa.com/t/random-frame-image-selections/27233 "2003-07-31T10:00:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussianBeer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/russianbeer/32/152_2.png) [@RussianBeer](https://forum.kirupa.com/u/RussianBeer)\
**Post date:** [July 31, 2003, 10:00am UTC](https://forum.kirupa.com/t/random-frame-image-selections/27233/1 "2003-07-31T10:00:11Z")

</div>

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](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](http://www.pacific-emarket.com/special_olympics/v4.0/html/volunteers.htm)  
Thanks again!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 10:15am UTC](https://forum.kirupa.com/t/random-frame-image-selections/27233/2 "2003-07-31T10:15:23Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 10:24am UTC](https://forum.kirupa.com/t/random-frame-image-selections/27233/3 "2003-07-31T10:24:39Z")

</div>

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

```auto

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 11:05am UTC](https://forum.kirupa.com/t/random-frame-image-selections/27233/4 "2003-07-31T11:05:01Z")

</div>

Work great, thanks alot guys!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 11:08am UTC](https://forum.kirupa.com/t/random-frame-image-selections/27233/5 "2003-07-31T11:08:10Z")

</div>

welcome 🙂
