# Comparing / searching arrays

**URL:** <https://forum.kirupa.com/t/comparing-searching-arrays/223203>\
**Category:** Uncategorized\
**Created:** [April 20, 2007, 8:51am UTC](https://forum.kirupa.com/t/comparing-searching-arrays/223203 "2007-04-20T08:51:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![praxiz](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@praxiz](https://forum.kirupa.com/u/praxiz)\
**Post date:** [April 20, 2007, 8:51am UTC](https://forum.kirupa.com/t/comparing-searching-arrays/223203/1 "2007-04-20T08:51:49Z")

</div>

Greetings. Let me first say this is my first post, and I did search the forum and I found a great explenation on how to find a value in an array, but my problem is a little different and I’m not smart enough to figure it out on my own.

I have a random picture-script that, not surprisingly, shows random pictures.

Basically I have one array with all the imagenames which i shuffle every time the image is going to change.

```auto
pic_arr = ["images/1", "images/2", "images/3", "images/4", "images/5", (.....) "images/55", "images/56", "images/57"];

```

And one array that keeps track of every image that has been displayed.

```auto
function shuffle(a,b){
return random(2);
} 
pic_arr.sort(shuffle);
holder_mc1.loadMovie(pic_arr[0]+".jpg");

i = folder.length;
folder* = pic_arr[0]; 

```

So after the image has changed a three times, the folderarray looks something like this.

```auto
folder = ["images/21", "images/12", "images/43"];

```

Now I need a script that will select a value from pic\_arr that ISN’T a value in folder. I’ve tried for a few days now but I’ve gotten nowhere.

Please help?

Thank you in advance. 🙂
