A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Caps Lock Detection

  1. #1
    Junior Member
    Join Date
    Oct 2009

    Question Caps Lock Detection

    I am designing a webpage with a password (yes, I know it can be hacked)

    I want to be able have an alert appear in the textbox "mess" when the Caps Lock key is activated. (not just being held down). I have already tried this and it comes out as staying on until you leave the page or mess changes.

    var keyListener:Object = new Object();
    keyListener.onKeyDown = function() {
        if (Key.isDown(Key.CAPSLOCK)) {
        mess = "CAPS LOCK IS ON!"
        trace("\tCaps Lock == "+Key.isToggled(Key.CAPSLOCK));
    What can I put to make the "CAPS LOCK IS ON" go away when the capslock is off?

    Thanks much,

  2. #2
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Quite tricky...but shold be easy....can you just upload ur FLA here so we cud work directly on it ?
    As ever,
    Vinayak Kadam

Tags for this Thread

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