# Random MC placement on predefined coordinates

**URL:** https://forum.kirupa.com/t/random-mc-placement-on-predefined-coordinates/146357
**Category:** Uncategorized
**Created:** [April 30, 2005, 11:15am UTC](https://forum.kirupa.com/t/random-mc-placement-on-predefined-coordinates/146357 "2005-04-30T11:15:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)
#### Post date: [April 30, 2005, 11:15am UTC](https://forum.kirupa.com/t/random-mc-placement-on-predefined-coordinates/146357/1 "2005-04-30T11:15:03Z")

</div>

Hello, please see the file attached. I have 1200x900 px stage that includes  
5 (400x300 px) Mcs and 1 (800\*600 px) MC. All of these are external SWFs. the think I want it everytime I open the main SWF I want number 6 stay at the same place while other 5 will change places in a random manner.  
How to achieve that ? Thanks so much.

I use this:

boxes = Array();  
for(i=0; i\<5; i++) {  
newMc = Math.floor(Math.random()\*4);  
boxes.push(newMc);  
loadMovie(“mc”+i+".swf", “holder”+newMc);  
}  
loadMovie(“mc6.swf”, “holder6”);

now I know the thing I need to do is, if the random generated newMC exists in boxes array it have to regenerate another one that doesnt in the boxes. But I cant find a command or sloution to do that.
