# Get a simple key movment here

**URL:** https://forum.kirupa.com/t/get-a-simple-key-movment-here/142146
**Category:** Uncategorized
**Created:** [March 25, 2005, 9:56pm UTC](https://forum.kirupa.com/t/get-a-simple-key-movment-here/142146 "2005-03-25T21:56:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SilverFalcon](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@SilverFalcon](https://forum.kirupa.com/u/SilverFalcon)
#### Post date: [March 25, 2005, 9:56pm UTC](https://forum.kirupa.com/t/get-a-simple-key-movment-here/142146/1 "2005-03-25T21:56:35Z")

</div>

## this is a code for a simple key movment you can go in all directions.

onClipEvent(enterFrame){  
if(Key.isDown(Key.UP)){  
this.\_y -= 5;  
}  
}  
onClipEvent(enterFrame){  
if(Key.isDown(Key.DOWN)){  
this.\_y += 5;  
}  
}  
onClipEvent(enterFrame){  
if(Key.isDown(Key.LEFT)){  
this.\_x -= 5;  
}  
}onClipEvent(enterFrame){  
if(Key.isDown(Key.RIGHT)){  
this.\_x += 5;  
}

}

* * *

for people who dont understand this code to change the speed where the “5” is change that to make it go faster or slower.  
hope it works.
