*blog... kind of... *rss
Flash player 8 onKeyUp bug
8 comments written so far...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.
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.
Teniendo en cuenta la penetración (perdón x la palabra) del player 9 ultimamente... lo mismo en pocas semanas-meses esto ya no es un problema... o al menos, un problema menor...
Well, I guess they fixed that too with flash player 8.5, but I can't be asked testing it now.
LARGA VIDA AL TEST!!
Mejor no lo reportes a su bigtracker o te denuncio por intrusismo laboral :D
Mejor no lo reportes a su bigtracker o te denuncio por intrusismo laboral :D
Hey Ricardo,
I've got the same problem. I'm creating a loop based sequencer in flash wich containes a synthesizer emulator. you can play the synth with the computerkeyboard. Only when you make a chord with more keys, when released it keeps playing the sound of the first button pressed.
Since not everyone has flash player 9 i hope there is another solution... Do you know if there is a way to script around this bug?
Cheers,
erjee
I've got the same problem. I'm creating a loop based sequencer in flash wich containes a synthesizer emulator. you can play the synth with the computerkeyboard. Only when you make a chord with more keys, when released it keeps playing the sound of the first button pressed.
Since not everyone has flash player 9 i hope there is another solution... Do you know if there is a way to script around this bug?
Cheers,
erjee
well, I'm sure it must be a way, but I think I won't bother, I'll move directly to 8.5 - 9
ow sorry hehe, the name was Mr doob right?
Yep :)
Have your say!
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
more: github, twitter, twitpic, soundcloud and flattr
*post nav
mudballs, live at sundown
exe2swf
Rotozoomer with ActionScript 3
No more blogging...
The accessibility is inaccessible
Flash player 8 onKeyUp bug
Converting Demos to .MOV (h264)
Incoming events...
New iPod Shuffle! Oh noo!
byebye: the solution
byebye
*latest comments
Merry Xmas
Multiuser Sketchpad
Multiuser Sketchpad
Or so they say... (javascript demo)
Multiuser Sketchpad
Or so they say... (javascript demo)
Or so they say... (javascript demo)
Or so they say... (javascript demo)
Or so they say... (javascript demo)
Harmony
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!