# Easy Q. "Movement Using ActionScript" Tutorial

**URL:** https://forum.kirupa.com/t/easy-q-movement-using-actionscript-tutorial/466
**Category:** flash
**Created:** [July 18, 2002, 3:50am UTC](https://forum.kirupa.com/t/easy-q-movement-using-actionscript-tutorial/466 "2002-07-18T03:50:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pura\_Vida](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@Pura\_Vida](https://forum.kirupa.com/u/Pura_Vida)
#### Post date: [July 18, 2002, 3:50am UTC](https://forum.kirupa.com/t/easy-q-movement-using-actionscript-tutorial/466/1 "2002-07-18T03:50:07Z")

</div>

What I have to do in order to make this animation to **Loop**  
Because it play only ones and then disappear

onClipEvent(enterFrame) {  
speed = 1;  
this.\_x += speed;  
}

Thank you in advance.

---

<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: [July 18, 2002, 4:11am UTC](https://forum.kirupa.com/t/easy-q-movement-using-actionscript-tutorial/466/2 "2002-07-18T04:11:12Z")

</div>

This is the code that worked for me. The first number that I checked for is the width of the movie in this case 550, and -114 I got from the width of my object you can change this depending on the width of your object, when you tell it to return after it has passed 550 you want to make it seem like its coming back out the other side so if you take the width of your object and make it equal to where it would go back to, it makes the animation seemless. You change this number to a positive and the animation will become jumpy as it goes from 550 to say 14(14 is just an example).

onClipEvent (enterFrame) {  
speed = 1;  
this.\_x += speed;  
if (this.\_x \> 550) {  
this.\_x = -114;  
}  
}

Hope this helps.

Kyle

---

<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: [July 18, 2002, 5:01am UTC](https://forum.kirupa.com/t/easy-q-movement-using-actionscript-tutorial/466/3 "2002-07-18T05:01:33Z")

</div>

Thank you iceman  
Work very smooth:)
