(Code 38) upwards and downwards (keyCode 40) reverse keys?

Hello world

I use Adobe Flash CS4. I just picked up a tutorial for the entrance to the keyboard and when I test my movie, the up arrow key causes the movement downwards and the down key causes the movement upwards.

Here is my code:

function onKeyPress(event:KeyboardEvent):void {}

If {(event.keyCode is 38)

trace ("pressed up arrow on");

ball.y += movement;

}

If {(event.keyCode is 40)

trace ("pressed down arrow on");

ball.y = movement;

}

I use a chart called "ball" here.

Anyone know why this is happening?

Thanks for reading

the values of y increase as you move towards the bottom of the scene.  You want to reduce the value of y to move up and increase it to go down.

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • How many times should I empty the cache memory?

    I had problems with various Web sites and on other users advice made a full cache clear. I noticed an immediate improvement in the speed of loading pages. Do you have this help and if yes how often should I clean the cache? It is 420MB. Thank you

  • Satellite L670-DX1 - after the installation of SP1 cannot use the memory card reader

    Hello Since I upgraded my Satellite L670-DX1 of Win7 64 bit to Win7 64-bit SP1 (2 days ago) I can't use my memory card reader, he always says it is a bad card and I should reformat the card with any card. Does anyone have a similar problem or better

  • Whats error Ox800106ba?

    I tried to turn on my windows Defender. He froze for code error a bit then poped Ox800106ba upward. I have service pack 2 and just can't make it work.

  • other people use our internet connection, what can I do?

    I set it up to be pass code protected. then I had to do a system restore and now people are on my internet and hit me. I forgot the access code, it does not give a prompt for forgotten passwords. I thought that the restoration would also restore the

  • BCCode: 1000008e BCP1: C0000005 BCP2: 00020003 BCP3: F06A0904

    Hello When I started working with Micr.Ofiice Word, type the first cheracters my IBM PC restarts. The key combination is always different and the time is different, so I can't find a setting. The error signature is: BCCode: 1000008e BCP1: C0000005 BC