1st time using an EventListener for a KeyboardEvent and I cant make it work:
Here is the code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, Cal);
function Cal(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.ENTER) {
Calco();
}
}
The errors I get are:
Scene 1, Layer ‘Actions’, Frame 1, Line 95 1136: Incorrect number of arguments. Expected 1.
line 94 is the if line and 95 the Calco thing…
I dont get where is the problem. I have another sample of code that works fine and I used it as an example.
Some thoughts… and working example: