# Loading random jpgs in several mcs without repeating. ( how? )

**URL:** <https://forum.kirupa.com/t/loading-random-jpgs-in-several-mcs-without-repeating-how/170213>\
**Category:** flash\
**Created:** [November 23, 2005, 7:22pm UTC](https://forum.kirupa.com/t/loading-random-jpgs-in-several-mcs-without-repeating-how/170213 "2005-11-23T19:22:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superman55](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/superman55/32/1954_2.png) [@superman55](https://forum.kirupa.com/u/superman55)\
**Post date:** [November 23, 2005, 7:22pm UTC](https://forum.kirupa.com/t/loading-random-jpgs-in-several-mcs-without-repeating-how/170213/1 "2005-11-23T19:22:45Z")

</div>

Hello,

well i have 3 mcs (mc1,mc2,mc3), each loads .jpg files in it randomly. The question is how to make each of them not repeat previously loaded one.

Example of code that im using

```auto
 
filename = ["image"+random(7)+".jpg"]; 
path = "img/"; 
i = filename.length; 
k = Math.floor(Math.random()*i); 
loadMovie(path+filename[k], mc1);

```

for example sometimes mc1 would load image1.jpg and others would load the same and so on. how to avoid such repeating ?

thanks
