Allright, here’s the deal:
How to make a script function so, that it would monitor a single button of the keyboard and act accordingly whether the button in question is pressed or not.
With the isDown, inside enterFrame, you get, for example, this:
<pressing key>
do what is defined in AS
do what is defined in AS
do what is defined in AS
do what is defined in AS
do what is defined in AS (and so on until…)
<releasing key>
nothing
I seriously NEED it to do this instead:
<pressing key>
do what is defined in AS
… nothing should happen even if you hold it
<releasing key>
do what is defined in AS
So,
- I need a piece of code that monitors a single key, definable by let’s say keycodes
- Another piece of code, that allows me to define things to be done only ONCE when the button is both pressed and released.
I’ve read a ****load on listeners etc, and they all end up in the same situation: your flash listens if you are pressing and/or releasing, but leave out the part where you actually make it useful by defining which button should be listened to. Why can’t there be a Key.onPress and Key.onRelease… God I hate and love flash.
Edit: Being somewhat of a beginner in AS, I’m not even sure whether listeners are the answer to my problem.