4 Replies Latest reply on Nov 26, 2006 10:53 PM by SiuLinda

    Classic Text Box Bug

    SiuLinda Level 1
      Dear all,
      I found a problem with the Director text box, in fact, I created it for user input but I found that if the user clicks "Page up", "Page down", "Home", "End", "Insert", "Delete", etc buttons, these keys are inputted though can't be displayed in the text box. Is it a bug in text box ?

      Could anybody tell me how to get rid of these inputs?

      Thanks in advance.

        • 1. Re: Classic Text Box Bug
          Level 7
          This suggests you have a behavior attached to the text sprite. You'll
          need to trap these keys in your keyDown/Up handler and stop them from
          being "displayed" with 'stopEvent'
          • 2. Re: Classic Text Box Bug
            SiuLinda Level 1
            Thanks for your solution but it is quite difficult to do, cos the users can input chinese character which is a combination of serveral keys together to make a character, if I trap the keyup and keydown, it is difficult for them to type chinese.
            • 3. Re: Classic Text Box Bug
              James Newton, ACP Level 3
              Try adding a behavior to your text sprite with this scriptText:

              on keyDown(me)
              --put the keyCode, the key

              case the keyCode of
              115: -- Home
              116: -- Page Up
              119: -- End
              121: -- Page Down

              end case
              end keyDown

              This should block the keys you mention, and let all other key inputs pass to the text member where they will be displayed. If there are other keys that you want to block, uncomment the first line; you will then see output in the Message window each time you type a letter. This will let you know what other keyCodes you should add to the case statement.
              • 4. Re: Classic Text Box Bug
                SiuLinda Level 1
                Sure, I will have a try to see if it can do in my situation, but really want to ask why Director lets Text box accepts these characters, it is strange.
                Anyway, thanks a lot!