A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] escape key problom

  1. #1

    [F8] escape key problom

    I have a code from previous code of flase, that use ESC key,
    this code is not working when I publish my movie to flash 8 movie,

    code:

    global.myKeyHandler = new Object()

    _global.myKeyHandler.onKeyUp = function(){
    var theKeyCode = Key.getCode();
    trace(theKeyCode)
    switch(theKeyCode) {
    case Key.ESCAPE: // ESC pressed
    trace("ESC pressed");
    break;
    case Key.TAB: // tab key
    trace("TAB pressed");
    break;
    }
    }

    Key.addListener(_global.myKeyHandler);



    when i test the movie (Control > Test Movie) it can work only if chose to publish to older flash player or if I chose to disable keyboard shortcuts
    (Control > Disable Keyboard Shortcuts).

    it look like the "esc" key is disabled for flash 8, is there a way to bypass this?

    10x

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    It's
    code:

    _global.myKeyHandler = new Object()
    // not
    global.myKeyHandler = new Object()



    Apart from this, as long as you disable shortcut keys as you've mentioned, it works just fine in Fash 8, published for any flash player version... (8, 7, 6) and AS version (1, 2).

  3. #3

    global is not the issue

    "as long as you disable shortcut keys as you've mentioned,"

    the global is not the issue,it can be _global, global and or be remove. disabaling shortcut key is available only when testing the movie inside flash program, in the development envierment,
    how can i disable them by code?

  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    I tried it and the escape key gets detected (when published for FP8) in Firefox, IE and in a projector.
    The only exception is the external test player, i.e., when I open the .swf directly.

    What exactly doesn't work for you?

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