Archive for February, 2009
Key events in AS3 and the missing Key.isDown()
Wednesday, February 11th, 2009When AS3 came out many people, myself including, were frustrated and confused by the lack of a quick and dirty function to check whether a key was down (pressed). You can have a listener that gets fired when a key is pressed and see which key it was within that function. This could lead to someone putting all their key behaviour code in one spot which could become quite messy.
The best way to fix this is with a class that does all the heavy lifting for you. Without any any further ado here’s the test. Use the arrow keys, space, z and shift+z to try it out [source]:
Posted in Flash | 2 Comments »