# Mc x and y min and max parameters

**URL:** <https://forum.kirupa.com/t/mc-x-and-y-min-and-max-parameters/251345>\
**Category:** flash\
**Created:** [February 7, 2008, 4:10pm UTC](https://forum.kirupa.com/t/mc-x-and-y-min-and-max-parameters/251345 "2008-02-07T16:10:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![platinum2151](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/platinum2151/32/2857_2.png) [@platinum2151](https://forum.kirupa.com/u/platinum2151)\
**Post date:** [February 7, 2008, 4:10pm UTC](https://forum.kirupa.com/t/mc-x-and-y-min-and-max-parameters/251345/1 "2008-02-07T16:10:27Z")

</div>

I have a script that loads a movie clip at a different location every time on the stage:

\*\*photo1.\_x = Math.random() \* 600;  
photo1.\_y = Math.random() \* 600;

\*\*This works fine. All I would like to do now is add a minimum and maximum of some kind so that my clip never load hanging half off of the stage. I tried this among other things:

\*\*photo1 = Math.min(stage.width - 100, stage.width - 100);  
photo1 = Math.max(stage.width - 100, stage.width - 100);

\*\*I tried a number of other ways to add x and y parameters but never got the result I wanted. Any ideas? Much appreciated.
