# Flash key movements

**URL:** <https://forum.kirupa.com/t/flash-key-movements/105277>\
**Category:** Uncategorized\
**Created:** [March 24, 2004, 6:03pm UTC](https://forum.kirupa.com/t/flash-key-movements/105277 "2004-03-24T18:03:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExxWhyZee](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@ExxWhyZee](https://forum.kirupa.com/u/ExxWhyZee)\
**Post date:** [March 24, 2004, 6:03pm UTC](https://forum.kirupa.com/t/flash-key-movements/105277/1 "2004-03-24T18:03:03Z")

</div>

Hello there,

I just had a question on using a key to move an object.

```
here is the key code I used:

```

on (keyPress “j”) {  
currentX = this.\_x;  
this.\_x = currentX - 2;  
\_root.bug.\_rotation = 270;  
}  
on (keyPress “l”) {  
currentX = this.\_x;  
this.\_x = currentX + 2;  
\_root.bug.\_rotation = 90;  
}  
on (keyPress “i”) {  
currentY = this.\_y;  
this.\_y = currentY - 2;  
\_root.bug.\_rotation = 360;  
}  
on (keyPress “k”) {  
currentY = this.\_y;  
this.\_y = currentY + 2;  
\_root.bug.\_rotation = 180;  
}

I was just curious on how ya can stop it from going to far?  
[http://xyz.home.mchsi.com/keys\_final.html](http://xyz.home.mchsi.com/keys_final.html)
