Adding true to an array at the index of the keycode instead of adding the code to it might be better on looking through the array. Because you do not have to use for loop.

Adding:
pressedKeys_array[Key.getCode()] = true;

Looking:
bIsDown = pressedKeys_array[Key.getCode()]
_____
Newsdee wrote:
I can see a workaround though:

It would be not too hard to write a class that listesn to the keyboard, and
when an onKeyDown event is triggered, it reads the key and adds the keycode
to an array.

The keycode is then removed at an onKeyUp event. And the isDown method would
just have to look through the array.

Good luck,

Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books<http://www.FumioNonaka.com/Books/index.html>
Flash community<http://F-site.org/>

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to