Probably a simple keyboard event question...
I'm new to AS3 and can't figure this out...
I want to add the function nextClip(); away from a button to the spacebar. So when I click the spacebar, it runs the nextClip();
btnNext.addEventListener(MouseEvent.CLICK, playNext);
function playNext(e:MouseEvent):void {
nextClip();
index = (index + 1)%(clips.length);
}
I can figure out how to do it with any key press, but not with just the spacebar.
function checkKeysDown(event:KeyboardEvent):void{
nextClip();
index = (index + 1)%(clips.length);
}
Thanks in advance for any help.