# Move left and stop?

**URL:** https://forum.kirupa.com/t/move-left-and-stop/263921
**Category:** flash
**Created:** [June 20, 2008, 1:57pm UTC](https://forum.kirupa.com/t/move-left-and-stop/263921 "2008-06-20T13:57:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![csber3](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@csber3](https://forum.kirupa.com/u/csber3)
#### Post date: [June 20, 2008, 1:57pm UTC](https://forum.kirupa.com/t/move-left-and-stop/263921/1 "2008-06-20T13:57:05Z")

</div>

This is probably an obvious answer but… I currently have this code:

onClipEvent(enterFrame) {

this.\_x-=10;

if (this.\_x \> 35){  
this.\_x=stop();  
}  
}

The movie clip currently moves to the left as it should but I want it to stop when it gets to 35 on the x coordinates. Is there an easier way to do this?

---

<div class="post-metadata">

### Author: ![glosrfc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/glosrfc/32/8334_2.png) [@glosrfc](https://forum.kirupa.com/u/glosrfc)
#### Post date: [June 20, 2008, 2:12pm UTC](https://forum.kirupa.com/t/move-left-and-stop/263921/2 "2008-06-20T14:12:30Z")

</div>

There’s no easier way…but there’s definitely a more correct way as assigning stop() to the \_x property won’t work:

```auto
onClipEvent (enterFrame) {
	if (this._x > 35) {
		this._x -= 10;
	}
}

```

---

<div class="post-metadata">

### Author: ![csber3](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@csber3](https://forum.kirupa.com/u/csber3)
#### Post date: [June 20, 2008, 2:28pm UTC](https://forum.kirupa.com/t/move-left-and-stop/263921/3 "2008-06-20T14:28:44Z")

</div>

Fantastic! This was driving me nuts. Works perfect. Thank you!
