# Movement with AS

**URL:** <https://forum.kirupa.com/t/movement-with-as/98267>\
**Category:** Uncategorized\
**Created:** [January 5, 2004, 9:50am UTC](https://forum.kirupa.com/t/movement-with-as/98267 "2004-01-05T09:50:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voursez](https://avatars.discourse-cdn.com/v4/letter/v/b5ac83/32.png) [@Voursez](https://forum.kirupa.com/u/Voursez)\
**Post date:** [January 5, 2004, 9:50am UTC](https://forum.kirupa.com/t/movement-with-as/98267/1 "2004-01-05T09:50:35Z")

</div>

Hi, i have a problem with mving a object. I can move the object, but i need to have some restrictions on it. I need to disable the moving function, when it reaches 0 and 300 on the x-axis. Also i need when its being moved, that its easing, and i dont know how to do this either. I know i need some kind of if-else command for the restrictions, but i really need some help. This is all i got:

[AS]  
on (keyPress “\<Left\>”) {  
currentX = this.\_x;  
this.\_x = currentX - 5;  
}  
on (keyPress “\<Right\>”) {  
currentX = this.\_x;  
this.\_x = currentX + 5;  
}  
[/AS]
