Re: arrow keys with SWFBUTTON_KEYPRESS ?
Rog <[email protected]> Fri, 14 Nov 2003 14:00:56 -0800
| Newsgroups | gmane.comp.web.ming.general |
|---|---|
| Message-ID | <[email protected]> |
Okay, now I'm stuck with the next question related to this:
How should I capture the event to actually check for Key.UP? or to get the
question directly: Does Ming have an equivelant to onClipEvent(keyDown) ?
So I could make the equivilant of the following:
onClipEvent (keyDown) {
if (Key.getCode() == Key.UP) {
whatever = "whatever";
}
}
And if it doesn't, it seems like it should. Not just for the instances of
grabbing arrow keys, but for good control in games, etc. it would make
sense to have both onClipEvent(keyDown) and onClipEvent(keyUp).
SWFBUTTON_KEYPRESS needs a character to compare to, it doesn't seem to work
for this unless I'm mistaken (and if I am mistaken, can someone please tell
me how?).
Using SWFACTION_ENTERFRAME combined with Key.isDown() does *sorta* work:
if (Key.isDown(Key.UP)) {
whatever = "whatever";
}
But that seems like an awful sloppy and inefficient solution. It's rather
hit-and-miss connecting key presses with framerate, etc. and not at all as
solid feeling as SWFBUTTON_KEYPRESS.
Key.addListener() isn't available until Flash MX/6 and I for one haven't
been able get Ming 0.3a working for Flash 6 & 7 code.
Is there another event handler solution for arrow keys that I'm missing?
--
[email protected] (Rogdor)