3 Replies Latest reply on Feb 13, 2008 7:22 AM by Rothrock

    textFields

    swodiddy Level 1
      Is there a way to *select all* the contents of a textField when it receives focus? I can't find a thing in the documentation...
        • 1. Re: textFields
          Rothrock Level 5
          I think so, but oddly enough it isn't part of the TextField class. Instead check out the Selection class in the help files. I'm thinking setSelection() will be your best bet.
          • 2. Re: textFields
            swodiddy Level 1
            Thanks. I found this, for onEnterFrame, but I need it *only* for onFocus. Can you help me understand how to modify this:

            this.onEnterFrame = function () {
            Selection.setFocus("percent_txt");
            Selection.setSelection(0, 3);
            delete this.onEnterFrame;
            }
            • 3. Re: textFields
              Rothrock Level 5
              I'm sorry, but I really don't understand what you mean by that. If you don't need it for onEnterFrame, then don't use it with onEnterFrame. Like that old joke, "Doctor, it hurts when I do this. Well then don't do that."

              Check TextField onFocus and replace the onEnterFrame parts with the onFocus parts.