# Need help with left to right random movement

**URL:** <https://forum.kirupa.com/t/need-help-with-left-to-right-random-movement/160442>\
**Category:** Uncategorized\
**Created:** [August 25, 2005, 11:28pm UTC](https://forum.kirupa.com/t/need-help-with-left-to-right-random-movement/160442 "2005-08-25T23:28:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregle](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gregle/32/1687_2.png) [@gregle](https://forum.kirupa.com/u/gregle)\
**Post date:** [August 25, 2005, 11:28pm UTC](https://forum.kirupa.com/t/need-help-with-left-to-right-random-movement/160442/1 "2005-08-25T23:28:31Z")

</div>

Hi all. I’m trying to achieve random motion of my movie clips limited from stage left to stage right. I’ve read the following tutorials:

[http://www.kirupa.com/developer/mx/continuousmovement.htm](http://www.kirupa.com/developer/mx/continuousmovement.htm)

[http://www.kirupa.com/developer/mx/random\_motionMX.htm](http://www.kirupa.com/developer/mx/random_motionMX.htm)

both are helpful. However, I don’t want mouse position to affect anything (as it does in the ‘continuous movement’ tutorial). The ‘random motion’ code is pretty close…if I just knew what part of the code to modify to limit motion from left to right.

Can anyone offer some advice?
