# Random graphic?

**URL:** <https://forum.kirupa.com/t/random-graphic/12170>\
**Category:** flash\
**Created:** [January 27, 2003, 9:51pm UTC](https://forum.kirupa.com/t/random-graphic/12170 "2003-01-27T21:51:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TinLeg](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@TinLeg](https://forum.kirupa.com/u/TinLeg)\
**Post date:** [January 27, 2003, 9:51pm UTC](https://forum.kirupa.com/t/random-graphic/12170/1 "2003-01-27T21:51:29Z")

</div>

hi ppl,

I know theres a relativly simple way of inserting a random graphic into flash mx, ive saw it done, but cant remember how, any ideas  
please?

Ive looked on the web but not what im after

thx

---

<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:** [January 27, 2003, 10:00pm UTC](https://forum.kirupa.com/t/random-graphic/12170/2 "2003-01-27T22:00:01Z")

</div>

Easiest way:

Multiple frames, each with one image in it.

First frame will be empty and will have these actions on it…

```auto
gotoAndStop(random(_totalframes)+1);

```

It will choose a random frame and gotoAndStop there.

If you have too many images it will severly bump your load time though.

---

<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:** [January 27, 2003, 11:21pm UTC](https://forum.kirupa.com/t/random-graphic/12170/3 "2003-01-27T23:21:25Z")

</div>

thats gr8 thanx,

but…

I would like animation to take place while having a random graphic onscreen, how can i do this?

cheers  
=)

---

<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:** [January 28, 2003, 2:40am UTC](https://forum.kirupa.com/t/random-graphic/12170/4 "2003-01-28T02:40:19Z")

</div>

Put all of that inside a movie clip symbol.

Drag an instace of that movie clip symbol from the library and onto the \_root timeline (or wherever your animation takes place).

That way the image will be chosen in that movie clip, and that movie clip will be shown through your animation after the image is selected.

Now just to cover something. WHen you drag it to the stage from the library, drag it to its own layer and make sure the frames span across the whole part of the movie you want the image to be shown at. YOu can right click on the proper frame int he layer and choose “Insert Frame” to make sure it spans across the timeline where you want.

---

<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:** [January 28, 2003, 12:52pm UTC](https://forum.kirupa.com/t/random-graphic/12170/5 "2003-01-28T12:52:58Z")

</div>

thanx again,

but i still cant get it to work, ive got a layer with 1 blank frame with the code stated b4, then ive got sum keyframes on the same layer with the pictures on.

iv tried converting the frames to a movie symbol but still no good? am i doing this correct?

this symbol i have then dragged onto the stage, then it should work?

when i play the movie it only ever displays 1 pic and there is no amination just stuck on one frame

Cheers again!  
:trout:

---

<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:** [January 28, 2003, 1:20pm UTC](https://forum.kirupa.com/t/random-graphic/12170/6 "2003-01-28T13:20:28Z")

</div>

take a look at the example

---

<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:** [January 28, 2003, 2:57pm UTC](https://forum.kirupa.com/t/random-graphic/12170/7 "2003-01-28T14:57:29Z")

</div>

thanx every1 got it sorted! 🙂

---

<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:** [January 28, 2003, 3:01pm UTC](https://forum.kirupa.com/t/random-graphic/12170/8 "2003-01-28T15:01:07Z")

</div>

glad you got it to work 😉
