# Unique random image slide show help

**URL:** <https://forum.kirupa.com/t/unique-random-image-slide-show-help/319404>\
**Category:** Uncategorized\
**Created:** [February 19, 2011, 5:15am UTC](https://forum.kirupa.com/t/unique-random-image-slide-show-help/319404 "2011-02-19T05:15:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![diode1972](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@diode1972](https://forum.kirupa.com/u/diode1972)\
**Post date:** [February 19, 2011, 5:15am UTC](https://forum.kirupa.com/t/unique-random-image-slide-show-help/319404/1 "2011-02-19T05:15:53Z")

</div>

hey all,

I’ll admit up front I am an ActionScript neophyte. I have a client web site I built in AS2.0, and have been reluctant to overhaul in AS3.0. In any event, the client is asking me to add a front door slide show that cycles randomly through 11 product images. Seems easy enough, and I have managed to do that, but the problem I am having is how to get 11 unique numbers (i.e., image “no.2,” for example, gets chosen twice in a row, and I want to avoid that).

I know the solution has to do with arrays, which I am not entirely sure I understand. I get the basic concept (i.e., Flash keeping tracking of which 11 random numbers have already been used when determining the next random number), but I don’t totally understand how to insert that into the code/which frame in the timeline.

My .fla is available here: [www.nkhstudio.com/teaserv2.fla.zip](http://www.nkhstudio.com/teaserv2.fla.zip). Made in CS4.

It’s very simple, basically 12 frames; 1st frame is the AS that generates a random number 2-12, then goes to and plays frames 2 through 12 depending on the number generated. Problem I have is how to get Flash to remember the number chosen, so that when it returns to frame 1 to generate a new random number, it doesn’t pick from what it has previously chosen.

I have scoured this forum and others and while there are lots of posts about arrays and generating random numbers, the link I am missing is how particularly to apply this to Flash going to a particular frame to display an image/MC. Perhaps my whole structure (12 frames, AS on frame 1, images on frames 2-12) is not the best. I don’t know. Any help is appreciated!

many thanks,

-Nate
