A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Competing "Space" key control?

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    400

    Competing "Space" key control?

    Friends,

    I'm creating a little word game that includes a timer. Basically, you see how fast you can enter somebody's name.

    Here's my challenge. You hit the SPACE key to start and stop a timer. The problem is that when you enter the SPACE between somebody's first and last name, it stops the timer!

    Is there a way for the timer to disregard the SPACE key when you're in a text input field so it doesn't affect the timer?

    Thanks,
    Layne

  2. #2
    Senior Member
    Join Date
    May 2009
    Posts
    138
    Well, you could put a listener on the text field to stop the event from bubbling to whatever parent object is catching it. I have to think that there could be a better key for starting/stopping the timer, or perhaps you don't even need one at all - first keystroke starts the timer and once they have it typed you can stop it. Unless you want imperfect submissions, then maybe the return/enter key would work for the stop key - people are used to hitting enter to submit forms all over the place.

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