TonoNam
asked on
add event leastener for keyboard event spacebar
The case Keyboard.UP will execute if I press the up arrow in my kyboard. what should I write if I want to press the spacebarr for example. should it be somehting like case SpaceBar?
function Degree(event:KeyboardEvent ):void
{
switch(event.keyCode)
{
case Keyboard.UP :
rd();
break;
case Keyboard.DOWN :
ld();
break;
default :
break;
}
}
function Degree(event:KeyboardEvent
{
switch(event.keyCode)
{
case Keyboard.UP :
rd();
break;
case Keyboard.DOWN :
ld();
break;
default :
break;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.