# Random position moviclips again!

**URL:** <https://forum.kirupa.com/t/random-position-moviclips-again/107342>\
**Category:** Uncategorized\
**Created:** [April 14, 2004, 3:12pm UTC](https://forum.kirupa.com/t/random-position-moviclips-again/107342 "2004-04-14T15:12:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stockdill](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@stockdill](https://forum.kirupa.com/u/stockdill)\
**Post date:** [April 14, 2004, 3:12pm UTC](https://forum.kirupa.com/t/random-position-moviclips-again/107342/1 "2004-04-14T15:12:36Z")

</div>

Hi I have a flash gave that makes a transparent movieclip appear in random positions within a set grid each time the screen loads. However I have found that a lot of the time it is always in the top left corner. I don’t know if this is just coincidence. The code I am using is.

onClipEvent(load) {  
this.\_x = Math.random()_(440.1-\_width)+179.9;  
this.\_y = Math.random()_(335.4-\_height)+56.4;  
}

However the grid that it appears in is covered in other moviclips. ( for the game battleships) So I was wondering if there was a way that I could say – on load appear at random behing moviclip 1 or moviclip2 or moviclip3 or moviclip4.

Or whether I could get all the positions of the moviclips which cover the grid and make it appear at random that way.

e.g appear at w90.3 x213.7  
h 55.2 y 183.8  
or appear at w90.3 x213.7  
hh 55.2 y128.1 etc

I would be grateful for any help

lesley
