A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Key.ENTER

  1. #1
    The G5 SP N_R_D's Avatar
    Join Date
    Apr 2004
    Posts
    1,118

    Key.ENTER

    someListener = new Object();
    someListener.onKeyDown = function() {
    if(Key.isDown(Key.ENTER)) {
    trace("Hit the right one");
    } else {
    trace("Wrong ***** !!!");
    }
    };
    Key.addListener(someListener);

    I have to hold the enter key, then hit another to make it work...

    Whats the deal?

  2. #2
    Member
    Join Date
    Jul 2005
    Posts
    37
    Hey buddy,
    You are coding right, and your code is also running fine but the problem is you are using flash itself to view it. And in flash "ENTER" means play the movie. Try to view your SWF in browser not in flash.
    To check whether your code is running or not, put a dynamic text box in the stage and change its text on Key.ENTER

  3. #3
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    As dipankar.paul suggested, it should work if you test in the browser instead. if you want to use "test movie" in flash you can go to control > test movie, then control > disable keyboard shortcuts and it should now work there too.

  4. #4
    The G5 SP N_R_D's Avatar
    Join Date
    Apr 2004
    Posts
    1,118
    Cool beans ...yeah found that out

    www.dp-labs.com/hoa3

    home owner login..



    Thanks guys !!

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