[Help] Keystroke - More then once per hit?
Hey everyone,
I just have a question. This has always been a problem when I make things in flash , in this case a game, and it really fustrates me
If you use the whole "if (Key.isDown(Key.SHIFT))" or any key for that matter , flash considers it being pressed more then once when you clearly only pressed it once.
This is because it considered it pressed down constantly when you hold the key down , but it happens so fast that it seems to you as the user that you only pressed the key down simply once
This might not be a problem in most cases, but unfortunatly for me Im not part of that catagory. My problem is this:
1) Im making a platform game, but there are two characters in it. When you press the shift button, it will go to the other character and vice versa.
2) There is a _root.player = false; variable. False being the red character and true being the blue one
3) When you press the shift button, the variable should simple just change back and forth between true and false
4) But since Flash considers what seems to be one easy hit of the shift key a bunch of keystrokes, the _root.player variable changes between true and false numerous times sometimes causing it to land back on what it was originally
Anyways, if someone could help me out here it'll be greatly appreciated as always :)