Link to home
Start Free TrialLog in
Avatar of TonoNam
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;
}
}
ASKER CERTIFIED SOLUTION
Avatar of rascalpants
rascalpants
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial