|  | Simple question - how to get focus? |  | |
| | | Angyl |  |
| Posted: Thu Jul 10, 2008 10:44 pm Post subject: Simple question - how to get focus? |  |
I've checked the help files and searched on this board. There's plenty about focus problems but nothing gave me the single, easiest line I'm looking for:
How do I set focus on an object like an input textfield?
I'm making a form and when the user tabs into a field, the cursor is hard (or impossible) to see so you don't know where you are. I want to be able to code something like:
my_textField.onGetFocus(){ this.glowTo(0xFF0000); }
Thanks! |
| |
| | | SuperJAG |  |
| Posted: Thu Jul 10, 2008 11:37 pm Post subject: Re: Simple question - how to get focus? |  |
Try this.
// Choose a color for the border: my_textField.borderColor = 0xFF0000;
// When the text field is focused, show the border: my_textField.onSetFocus = function () {
this.border = true;
}
// When the text field is unfocused, hide the border: my_textField.onKillFocus = function () {
this.border = false;
} |
| |
| | | Angyl |  |
| Posted: Thu Jul 10, 2008 11:57 pm Post subject: Re: Simple question - how to get focus? |  |
| onSetFocus...that's what I needed, thanks. |
| |
|
|