Skip to content


Flex FocusManager and Cursor control

Working on a component which needs to programatically set focus to a TextInput field and make sure that the cursor is placed at the end of current value. I found this possible by using both the Flex FocusManager and also the setSelection() method of TextInput. Figured the code snippit might be useful to other people so here it is.

//assuming myInputField is the id of a TextInput fieldfocusManager.setFocus(myInputField);myInputField.setSelection(myInputField.length, myInputField.length);

Posted in Actionscript, Code.

Tagged with , .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Rodrigo says

    Thanx, man. It helped me… :)



Some HTML is OK

or, reply to this post via trackback.



close