# Simple movement script

**URL:** <https://forum.kirupa.com/t/simple-movement-script/267129>\
**Category:** flash\
**Created:** [July 28, 2008, 10:01pm UTC](https://forum.kirupa.com/t/simple-movement-script/267129 "2008-07-28T22:01:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tswanny](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@Tswanny](https://forum.kirupa.com/u/Tswanny)\
**Post date:** [July 28, 2008, 10:01pm UTC](https://forum.kirupa.com/t/simple-movement-script/267129/1 "2008-07-28T22:01:10Z")

</div>

hey all, I’m new to action script and to the forums here and would appreciate some help,

I am trying to get a MC to move left along the X axis then stop before it goes off screen,  
I looked at a tutorial here and was able to get it to move but i am not sure as to how to get it to stop, some sort of if x=15 then stop sorta thing

```auto

onClipEvent(enterFrame) {
    speed = -5;
    this._x += speed;
}

```
