How can I use two key at a time :
I wrote this code for single key …
stage.addEventListener(KeyboardEvent.KEY_DOWN, moving);
function moving(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.RIGHT)
{
ball.x += 5;
}
if (event.keyCode == Keyboard.LEFT)
{
ball.x -= 5
}
if (event.keyCode == Keyboard.UP)
{
ball.y -= 5
}
if (event.keyCode == Keyboard.DOWN)
{
ball.y += 5
}
}
but I want to use two keys at a time :-
for example:
right + down
right + Up
Left + down
left + Up
so how we can do this thing in AS3.0 ??