'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 1:[1]

First you need to change the focus:

textField.setFocus()

Then set the positoin:

textField.selectRange()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cynicaljoy