# Movement restriction

**URL:** <https://forum.kirupa.com/t/movement-restriction/304313>\
**Category:** flash\
**Created:** [February 5, 2010, 8:53am UTC](https://forum.kirupa.com/t/movement-restriction/304313 "2010-02-05T08:53:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SangHee](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@SangHee](https://forum.kirupa.com/u/SangHee)\
**Post date:** [February 5, 2010, 8:53am UTC](https://forum.kirupa.com/t/movement-restriction/304313/1 "2010-02-05T08:53:35Z")

</div>

Hi,  
I’ve made a sort of sliding menu which is basically a movie clip that has a function assigned to it that if the cursor goes over a button it starts moving in a direction.

```auto

_root.right.onRollOver = function() {
    goRight = true;
};
if (goRight) {
        _root.content._x -= 10;
    }

```

Now, I don’t want that “content” object to slide all the way out of the screen. How can I make it stop at certain position, say x=770? Or is there any way?
