onClipEvent (enterFrame) {
with (_root.shuttle) {
mySpeed = 40;
myRot = 15;
asky = Key.getAscii();
if (Key.isDown(Key.DOWN) || asky == 115) {
_y += mySpeed;
}
else {
_y += 0; }
This is a portion of the code for a game I am trying to make.
I am trying to make a movie clip move whenever the W,A,S,D or
arrow keys are pressed. For some reason, whenever I press the W,A,S or D keys, it moves and won’t stop instead of moving only once. I am pretty sure that I need to use the Key.isDown for this, but whenever I put “115” (the ascii keycode for S), or Key.isDown(Key.S), it doesn’t do anything. Any ideas on the proper syntax?
Thanks in advance.