dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Using "Esc" button in a projector file ??!

  1. #1
    Member
    Join Date
    Nov 2001
    Posts
    82

    Using "Esc" button in a projector file ??!

    Hi,

    I am publishing a movie as a windows projector file (EXE).
    I have a button on the stage, that by clicking a certain key, "q" for example - triggers a "quit" fscommand for the projector (simple action so far).
    My problem is that I would like this action to be trigerred by the ESC keyboard button - which seems to be impossible.
    The onKeyPress action doesn't seem to have such an option.

    Any suggestions??

    Thnx.
    --=={asaf}==--

  2. #2
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    ESC is a special key, and you have to tell the projector to listen for those. Try:

    code:
    fscommand("trapallkeys", "true"); 



    Edit:

    You can use a key listener like this:

    code:

    fscommand("trapallkeys", "true");

    kL = {} // create a key listener
    Key.addListener(kL); // add it
    kL.onKeyDown = function() { // define function to run on key down
    if (Key.getCode() == 27) { // ESC = code 27
    // ESC pressed
    }
    }

    Last edited by strille; 08-26-2003 at 08:50 AM.

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