# Loading unduplicated random images

**URL:** <https://forum.kirupa.com/t/loading-unduplicated-random-images/227843>\
**Category:** Uncategorized\
**Created:** [June 3, 2007, 12:06am UTC](https://forum.kirupa.com/t/loading-unduplicated-random-images/227843 "2007-06-03T00:06:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gnaws](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@Gnaws](https://forum.kirupa.com/u/Gnaws)\
**Post date:** [June 3, 2007, 12:06am UTC](https://forum.kirupa.com/t/loading-unduplicated-random-images/227843/1 "2007-06-03T00:06:57Z")

</div>

I have a number of images I’d like to appear in a random stacked order. I’m just starting with 3 for now but it could go as many as 24. Right now I just want the variables to each have a unique number that will become a keyframe number in a MC holding all the images.

This is my code that almost works…

```auto
dork = random(3)+1;
trace ("dork = " + dork);

cat = random(3)+1
if (cat != dork){
    trace("this works");
    
} else {
    cat = random(3)+1
    trace ("trying again");
    
}

trace ("cat = " + cat);

dog = random(3)+1
if (dog != cat and dog != dork){
    trace("this dog works");
    
} else {
    dog = random(3)+1
    trace ("trying dog again");
    
}

trace ("dog = " + dog + newline + "=============");

```

Thanks in advance!
