dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Disabling the ESC key?

  1. #1
    Does anyone know how to disable the escape key? This is only for the standalone flash player. I'm creating an interactive CD ROM for a graphics project at school, and what the user to click the EXIT button instead of pressing the Escape key. Does anyone know how to disable it?
    Can anyone please help, it's urgent.
    JC

  2. #2
    Member
    Join Date
    Jul 2001
    Posts
    88
    Originally posted by chewman2k
    Does anyone know how to disable the escape key? This is only for the standalone flash player. I'm creating an interactive CD ROM for a graphics project at school, and what the user to click the EXIT button instead of pressing the Escape key. Does anyone know how to disable it?
    Can anyone please help, it's urgent.
    JC

    fscommand ("trapallkeys", "true");

  3. #3
    Thanks for that, but how about if I only want to trap the ESC key, can I specify that individually?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    264
    Unfortuantly i don't think it's possible to trap just one key independently of the operating system as the OS picks the keyDown/up before the flash projector, so even though you can trap it individually within the player using:

    if(Key.getCode==Key.ESCAPE){
    fscommand ("trapallkeys", "true");
    }else{
    fscommand ("trapallkeys", "false");
    }

    it will only come into effect after the key action of the OS, so it's useless!

    I suppose you could experiment with trapping all keys on(load) and then using keyUp/Down events to turn trapallkeys on or off to simulate trapping just the ESCAPE key!

    give it a try!

    Sam




  5. #5
    thanks for that sam.
    I understand now. I was playing around yesterday trying to get it working, but obviously it didn't. Still learning though.

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