Forums

ForumsProgramming Forum

Code which about pressing button

Posted Apr 29, '08 at 7:04am

machinegun

machinegun

7 posts

Th players can press "W A S & D" to control the movement of the chacters during the game. But, what is the code of this?
Moreover, I don't know what the name of the button is.
For ex. "space" button is :
if (keyisDown(Key(space)){
_root.gotoandplay(2);
}

But , how about other?(Key"A","B","c"...)
If I write this:
if (keyisDown(Key(A)){
_root.gotoandplay(2);
}
It didn't work when I press button "A"?!
Can someone tell me about this???

 

Posted Apr 29, '08 at 10:05pm

dank

dank

1,045 posts

Knight

You have to use the integer ASCII value in place of the letter.

 

Posted Apr 30, '08 at 5:47am

machinegun

machinegun

7 posts

what is the integer ASCII value ?
Where is it?
How do I use it?

 

Posted May 4, '08 at 10:55pm

MikeVarilek

MikeVarilek

38 posts

http://en.wikipedia.org/wiki/ASCII
Under Ascii printable Characters, use the Dec number for the letters
so 65 for A
66 for B
etc...

 

Posted May 5, '08 at 4:24am

flipje225

flipje225

1 post

use the assistance and chose "on" and you can type in your key, A, B, C, 1,2, and forward

 
Reply to Code which about pressing button

You must be logged in to post a reply!