;

PDA

Click to See Complete Forum and Search --> : Converting Key.getAscii value to character


Nightcap
09-27-2007, 11:08 PM
My code is reading keystrokes using Key.addListener. That works great, but the only way I can convert the Key.getAscii value to a character is by doing it like this:

String.fromCharCode(Key.getAscii())
Is that correct or is there a better way? Am I right that KM doesn't support the 'chr' and 'ord' functions?

Nightcap
10-01-2007, 02:16 PM
Bump...

Nobody?!? :confused:

w.brants
10-01-2007, 03:16 PM
You did it the right way.
Both 'chr' and 'ord' were deprecated years ago.

Nightcap
10-01-2007, 05:54 PM
Thanks Wilbert, that was all I needed to know. :)

It can be quite confusing looking at older AS examples and then finding out that the code won't work because of something like 'chr and 'ord'. But we'll get there.