Up (keyCode 38) and Down (keyCode 40) Keys Reversed?
Hi everybody,
I am using Adobe Flash CS4. I just took a tutorial for keyboard input, and when I test my movie, the up key causes downward motion and the down key causes upward motion.
Here is my code:
function onKeyPress(event:KeyboardEvent):void {
if (event.keyCode==38) {
trace("up arrow pressed");
ball.y+=movement;
}
if (event.keyCode==40) {
trace("down arrow pressed");
ball.y-=movement;
}
I am using a graphic called "ball" here.
Does anybody know why this is happening?
Thanks for reading
