PDA

View Full Version : set focus to textfield manually


GRUMBLE
04-29-2008, 04:53 PM
hello,

is it possible to set the keyboardfocus to a certain text with actionscript code?

i have been playing around with FocusManager and Textfield.setSelection() as well as the focus property of the stage but without any success.

thanks a lot for any help on this issue.

flexy
04-29-2008, 05:43 PM
Try using the object's stage reference:

myTextField.stage.focus = myTextField;
myTextField.setSelection( 0, myTextField.text.length );

GRUMBLE
04-29-2008, 06:17 PM
thank you! that works!