What a silly bug made me lose quite a bit of time!!!
Ok, If you were planing of doing a game controled by the keyboard for
Flash player 8 you'll find a little BIG issue. Using this code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
trace("PRESSED -> Code: "+Key.getCode()+" ASCII: "+Key.getAscii()+" Key: "+chr(Key.getAscii()));
};
keyListener.onKeyUp = function() {
trace("RELEASED -> Code: "+Key.getCode()+" ASCII: "+Key.getAscii()+" Key: "+chr(Key.getAscii()));
};
Key.addListener(keyListener);
Then, if you doing this sequence:
1. Press DOWN (40)
2. Press RIGHT (39)
3. Release RIGHT (30)4. Release DOWN (40)
You'll get this result exporting to with Flash player 7:
PRESSED -> Code: 40 ASCII: 0 Key:
PRESSED -> Code: 39 ASCII: 0 Key:
RELEASED -> Code: 39 ASCII: 0 Key:
RELEASED -> Code: 40 ASCII: 0 Key:
However, with Flash player 8 player you'll get this:
PRESSED -> Code: 40 ASCII: 0 Key:
PRESSED -> Code: 39 ASCII: 0 Key:
RELEASED -> Code: 39 ASCII: 0 Key:
As you can see,
Flash player 8 forgets which Keys you pressed as soon as you press another one, but without releasing the previous ones. Which may cause that your ship goes down automaticly.
Well, atleast looks like they've fixed this issue already in
Flash player 9.
#permalink
Share:Digg! ~
del.icio.us ~
Stumble ~
Furl ~
Reddit
Luckily they fixed in flash 9, but now everybody with flash8 can't play that mysterious game you're developing in the dark! Does it have ships and aliens? Then I'd love to test it!