Flash key movements

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