Search code examples
actionscript-3apache-flexactionscriptflex4

Want to set cursor position in Spark textinput control in Flex


I use Flex 4.5. I want to set cursor position based on integer variable. For example if my variable value is 5 then cursor in textbox will point to position 5. So there is any way to achieve this??

Thanks in Advance.


Solution

  •  textInput.setFocus();
     textInput.selectRange(caretPosition, caretPosition);