# Movement Using ActionScript

**URL:** <https://forum.kirupa.com/t/movement-using-actionscript/12130>\
**Category:** flash\
**Created:** [January 27, 2003, 12:33pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130 "2003-01-27T12:33:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![reweb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/reweb/32/135_2.png) [@reweb](https://forum.kirupa.com/u/reweb)\
**Post date:** [January 27, 2003, 12:33pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/1 "2003-01-27T12:33:30Z")

</div>

I have an oblect and I wanna move it continuously ( loop ) along the X axis. :\*(  
10x

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 12:38pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/2 "2003-01-27T12:38:51Z")

</div>

```php
onClipEvent (load) {
     end = Stage.width + (this._width / 2)
     begin = - (this._width / 2)
     speed = 10
}
onClipEvent (enterFrame) {
     if (this._x < end) {
          this._x += speed
     } else {
          this._x = begin
     }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 12:45pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/3 "2003-01-27T12:45:21Z")

</div>

be aware that stage width includes all of the visible flash area so in testing, if testing maximized, you’ll get different results from those given from an embedded or correctly sized movie (I always hardcode such values). That and the \_width/2 thing only works if your registration point is centered.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 12:53pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/4 "2003-01-27T12:53:56Z")

</div>

interesting points there sen … never thought about it :cyclops:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 1:03pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/5 "2003-01-27T13:03:36Z")

</div>

Don’t Work.  
I attach a fla file.  
Make tke sky loop if you can :beam:  
10x

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 1:14pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/6 "2003-01-27T13:14:16Z")

</div>

```auto
onClipEvent (load) {
     end = -1498
     begin = 0
     speed = -30
}
onClipEvent (enterFrame) {
     if (this._x > end) {
          this._x += speed
     } else {
          this._x = begin
     }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 1:26pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/7 "2003-01-27T13:26:37Z")

</div>

Thanx a lot. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 1:32pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/12130/8 "2003-01-27T13:32:15Z")

</div>

no problem :beam:
