:: Strange VC++ and Flash Key.isDown problem ::
I have written a new software to integrate industrial joystick with a
onscreen monitor (a flash swf).
In VC++ I am sending a right arrow key to the flash player using the
following user32.dll function:
keybd_event( VK_RIGHT,0x45, KEYEVENTF_EXTENDEDKEY | 0,0 );
keybd_event( VK_RIGHT,0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,
0 );
Now interestingly enough Key.getCode works fine with it, except, as
Key.getCode gives the last key pressed, it seems to execute on every
frame even if the key was pressed only once.
onClipEvent (enterFrame) {
if (Key.getCode() == Key.RIGHT){
trace("Right Key was pressed once");
}
}
But when I use the Key.isDown(Key.RIGHT) function nothing is received
in the flash player window.
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){
trace("Right Key was pressed once");
}
}
Can anyone help please?? Can you point what's wrong with it ...
If possible give a solution as the application already has
Key.isDown() function used in it a number of times.
Thanking all.
Faisal.