A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: This is a hard one to break

  1. #1
    Join Date
    Jan 2001
    Nobody seems to know how to detect the functions keys like F4 F6 F7 F11.

    if i use on keypress/keycode detect it sure detects it en works fine off-line.

    when operating in a browserwindow (IE) the functions keys interact with the browser instead of the SWF.

    REALLY NEED HELP - the only solution i got now is to make a keyboard image and make buttons of the F keys wich the users needs to click on. not much of a software simulation huh :-/

  2. #2
    Senior Member
    Join Date
    May 2001
    I do not think that will work out.

    Your SWF is loaded in either IE, Netscape or Flash Player. There is preview mechanism. If the loader open a call-back function for you, that will be fine. Otherwise, all the keycode are first screened for acceleration key before they are passed to the SWF.

  3. #3
    Junior Member
    Join Date
    Jun 2001
    From "ActionScript: The Definitive Guide" p.206

    "The function keys F1...F12 are not supported by keyPress, but are detectable using the Key object"

    Try using the onClipEvent(keyDown) handler in conjunction with the Key object to detect what key was pressed.

    (from p.215):
    onClipEvent (keyDown) {
    //Retrieve ASCII value of the last key pressed...
    lastKeyPressed = String.fromCharCode(Key.getAscii());
    trace("You pressed the '" + lastKeyPressed + "' key.");

    If the problem exists because of a preview mechanism (ref: ericlin's reply), the signal is being intercepted before it ever gets to your movie. Therefore, you may have to dig into documentation on the loader to find a call-back function. The only call-back functions that ActionScript documents are the ones where something else needs to tie into a Flash call-back (i.e.: XML object).


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center