# Move Randomly

**URL:** <https://forum.kirupa.com/t/move-randomly/311832>\
**Category:** flash\
**Created:** [July 17, 2010, 4:50pm UTC](https://forum.kirupa.com/t/move-randomly/311832 "2010-07-17T16:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manojeet\_dhar](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@manojeet\_dhar](https://forum.kirupa.com/u/manojeet_dhar)\
**Post date:** [July 17, 2010, 4:50pm UTC](https://forum.kirupa.com/t/move-randomly/311832/1 "2010-07-17T16:50:54Z")

</div>

Please help. I want to move a Movie Clip randomly on stage. Let me elaborate. I want the MC moves towards \_x+ upto, say, 100, it then  
moves towards\_y+ upto, say, 100, it then moves towards \_x- upto, say,  
50, then it moves toeards \_x+, say, upto 300 and then towards \_y- upto,  
say, 150 and so on and so on. I tried it this way but did not succeed.

on Load {  
xstep=5  
ystep=5  
}  
on enterFrame{  
\_x=\_x+xstep  
if \_x\>100  
\_y=\_y+ystep  
if \_y\>100  
\_x=\_x+xstep  
}

It stops here. the MC does not move further in \_x+ direction. The script may look silly to experts. I beg to confess that I’m an amateur flash user  
trying to excel.
