Hello, I am kinda new to AS3 and I’m starting to learn it slowly but surely. But it seems that there are some “new kind” of errors I cannot find what is the problem. It seems also that I can’t try a few tutorials on my Flash CS3 for AS3 they bug.
Here is the class i have been trying. The file is named keyTest.as
package {
import flash.display.Sprite;
import flash.display.events.KeyboardEvent;
public class keyTest extends Sprite {
public function example() {
stage.focus = this;
addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
}
private function onKeyDown(event:KeyboardEvent):void {
trace("Key : " + event.charCode);
}
}
}
When I compile it returns me the following error
1046: Type was not found or was not a compile-time constant: KeyboardEvent.
On this line : private function onKeyDown(event:KeyboardEvent):void {
Please tell me what I am doing wrong ^^" (I tried to delete the ASO files like recommended in the FAQ but didn’t work either).
PS : Sorry if my English or the terms I use are bad.