# Movement

**URL:** <https://forum.kirupa.com/t/movement/257670>\
**Category:** Uncategorized\
**Created:** [April 16, 2008, 7:49am UTC](https://forum.kirupa.com/t/movement/257670 "2008-04-16T07:49:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gam99](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gam99](https://forum.kirupa.com/u/gam99)\
**Post date:** [April 16, 2008, 7:49am UTC](https://forum.kirupa.com/t/movement/257670/1 "2008-04-16T07:49:35Z")

</div>

Hi, I followed an older tut on this site about moving an MC using AS.

I can get it to do what I want with the code below when moving from left to right, and I assumed that by using negative values I could get it to go from left to right. But it won’t work. Can anyone help, as I’d like to set the movement r to l.

This code works left to right

onClipEvent(enterFrame) {  
speed = 2;  
if(this.\_x\< 160){  
this.\_x += speed;  
}  
}
