# Reverse movement direction

**URL:** <https://forum.kirupa.com/t/reverse-movement-direction/126966>\
**Category:** Uncategorized\
**Created:** [October 28, 2004, 9:28pm UTC](https://forum.kirupa.com/t/reverse-movement-direction/126966 "2004-10-28T21:28:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coche09](https://avatars.discourse-cdn.com/v4/letter/c/2bfe46/32.png) [@coche09](https://forum.kirupa.com/u/coche09)\
**Post date:** [October 28, 2004, 9:28pm UTC](https://forum.kirupa.com/t/reverse-movement-direction/126966/1 "2004-10-28T21:28:37Z")

</div>

hi guys, first of all: thanks in advance for your help!  
i thought doing this was going to be super easy but i cant figure out the way to do it now, thats why im coming to the flash gurus out here…  
its plain simple, i want a movieclip to move slowly from one side to the other till it hits position 220 in x and ‘bounce’ back (no physics involved here) until it hits 700 in x and back again.  
the script i have so far is:

onClipEvent (enterFrame){  
position = this.\_x;  
if (this.\_x \>= 220) {  
this.\_x = position - 2;  
}  
}

this is a slightly diff version but it just makes it jitter once it hits 220…

onClipEvent (enterFrame){  
position = this.\_x;  
this.\_x = position -2;  
if (this.\_x \<= 220){  
this.\_x = position +2;  
}  
}

some help would be greatly appreciated, i saw this posting but it didnt really help much cause i dont want the clip to jump all the way back to its original position:  
[http://www.kirupaforum.com/forums/showthread.php?t=47618&highlight=movement+bounce](http://www.kirupaforum.com/forums/showthread.php?t=47618&highlight=movement+bounce)  
thanks again  
c
