apache-flexflex4caretricheditabletext

Flex: Set caret cursor position in RichEditableText control


Is there a method to set the caret position within a RichEditableText control?

The control's contents can contain errors that the user must fix which are navigated though via Next/Previous buttons, and during the navigation I would like to set the caret cursor to the end of each error within the text.


Solution

  • First you need to change the focus:

    textField.setFocus()

    Then set the positoin:

    textField.selectRange()