Skip to main content
Inspiring
February 13, 2008
Question

textFields

  • February 13, 2008
  • 2 replies
  • 248 views
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...
This topic has been closed for replies.

2 replies

Inspiring
February 13, 2008
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.
Inspiring
February 13, 2008
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.
swodiddyAuthor
Inspiring
February 13, 2008
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;
}