Reputation: 1683
I saw a lot of examples of using .caretIndex to get the index of cursor inside a TextField text, but I'm using TextArea and there is no such property, only selection index. So how do I get the cursor index position from a TextArea?
Edit: ok, I did a test and selectionBeginIndex is returning a value. Is it "right" to use it, or is there some specific way?
Upvotes: 1
Views: 576
Reputation: 1103
you can use selectionBeginIndex
According to Adobe's documentation:
If there is no selection, this value is set to the position of the caret.
Upvotes: 1