*blog... kind of... *rss
Flash player 8 onKeyUp bug 19.09.2006 | |
| 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. | | posted by mr.doob at 23:23 | | 8 comments written so far |
| Amazing, how can they release new versions without testing this *basic* functionality? :D
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!
| posted by sole 20.09.2006 , 07:16 |
|
| 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...
| posted by humphr3y 20.09.2006 , 07:34 |
|
| Well, I guess they fixed that too with flash player 8.5, but I can't be asked testing it now.
| posted by mr.doob 20.09.2006 , 09:58 |
|
| LARGA VIDA AL TEST!!
Mejor no lo reportes a su bigtracker o te denuncio por intrusismo laboral :D
| posted by xphere 20.09.2006 , 11:08 |
|
| 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
| posted by erjee 25.09.2006 , 11:05 |
|
| well, I'm sure it must be a way, but I think I won't bother, I'll move directly to 8.5 - 9
| posted by mr.doob 25.09.2006 , 11:07 |
|
| ow sorry hehe, the name was Mr doob right?
| posted by erjee 25.09.2006 , 11:07 |
|
| Yep :)
| posted by mr.doob 25.09.2006 , 11:10 |
|
SORRY! Is not that I don't care about what you have to say, of course I do, but they are speaking louder and I lost my patience :(
|
|
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
serving to: Hi-ReS!
contact me: click here
*latest posts
* Showcase is back, now in Javascript (19.11.2008) * Zeh's Fnk (15.11.2008) * Lupen III (Italian Opening) VS Captain... (08.11.2008) * Duuuuude! (31.10.2008) * Pump 'N Seal, Jackie Chan, Manuela and... (26.10.2008) * Ubuntu 8.10 on a Macbook Pro (25.10.2008) * Ubuntu 8.04, Apple Keyboard - Change F... (22.10.2008) * Rules for making the internet a better... (21.10.2008) * The Magic of Viral (10.10.2008) * Jonathan Harris: Beyond Flash, an adde... (06.10.2008) * Zeitgeist: Addendum (05.10.2008) * Crisis (03.10.2008) * Youtube, now in Super HD! (30.09.2008) * Adobe AIR for Linux - Beta (28.09.2008) * What does the Google Chrome logo inspi... (28.09.2008)
*latest comments
* C++, SDL Coding? Maybe.. ;) (Preview) (trace) * C++, SDL Coding? Maybe.. ;) (Preview) (Joey) * La picaresca (spt) * Mr. Slip Up (ricardo) * La picaresca (ricardo) * La picaresca (spt) * La picaresca (sole) * Demoscene @ Cirsa (sml) * La picaresca (humphr3y) * La picaresca (alfio) * fiver2's new baby: debris (Jcl) * Barcelona = full of shit(s) (Soli) * Demoscene @ Cirsa (Scener) * Rar & unrar with Ubuntu (SethPlate) * Mindcandy 2 (Jcl)
*wish list
|