I’m moving an movieclip using the cursor keys. The device it has to run on, is too slow to process the keys realtime, so the keys are placed in a some sort of buffer and the object keeps on moving for a while when the key is released. The device places 8 keys in the buffer per second, but flash can only process 5 per second, so holding the key for a second, will look like I’ve pressed it almost twice as long. Does anyone know of a way to counteract this? I’ve tried using Key.isDown, but that returns true, even though they key is released, until the buffer is emptied. I’ve tried using the onKeyDown event to start the movement and stop the movement using the onKeyUp event, but it seems like the onKeyUp event only occurs when the buffer becomes empty. Even when I remove the onKeyDown listener, it seems like the buffer only decreases 1 key per frame. It might have worked when there is no keyrepeat in the hardware, but that is not an option. It would be helpfull if there was a timestamp indicating when the key was pressed, or some way to clear the buffer, but I’ve not found one.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Key Repeater Delay | 0 | 57 | April 11, 2005 | |
Key Repeater Delay
|
0 | 41 | April 11, 2005 | |
Actions continue after key is released | 0 | 119 | October 22, 2005 | |
Delayed keyPress Problem | 0 | 39 | June 17, 2005 | |
[Flashplayer Bug] SWF slows Down when KEY get pressed and hold | 0 | 114 | May 28, 2009 |