Hi
I’m realtive new to Flash, and I want to make a game where I can move my character using the arrows. I’m trying to do the function that receives the inputs inside a class, but I can’t call the function without errors.
This is my Player.as:
package teste{
import flash.display.*;
import flash.ui.Keyboard;
import flash.events.*;
public class Player extends MovieClip {
public function Move(event:KeyboardEvent) {
if (event.keyCode == 37 || event.keyCode == 65) {
trace("a");
}
}
}
}
And this is the code inside the first frame of my .fla:
import teste.Player;
var pla:Player = new Player();
pla.Move(event);
I get the following error in the line 5 of my .fla:
1120: Access of undefined property event.
Someone could help me?
Thanks for all the attention.