Hello everyone!
I’m making a car game and it’s going to be for two players, now I wonder what the code is for using keyboard keys? For example I want to use the buttons “E”, “D”, "A, “F” for controlling the second car. The code that I’m using is similar to this;
[COLOR=Blue]onClipEvent (enterFrame) {
if (Key.isDown(Key.HOME)) {
speed += .3;
}
if (Key.isDown(Key.END)) {
speed -= .25;
}
0.6xspeed
if (Math.abs(speed)>10) {
speed *= .9;
}
if (Key.isDown(Key.DELETEKEY)) {
_rotation -= 4.5;
}
if (Key.isDown(Key.PGDN)) {
_rotation += 4.5;
}[/COLOR]---------------------------------
Here I have used the “home”, “end”, “delete” and"pgdn" keys to controll the second car, and that is because it doesn’t work just changing “home” to “E”, flash won’t accept it. What’s the code for using letter as key? :-/