How do you programmatically move the caret of a Flex TextArea to the end?

前端 未结 6 1304
眼角桃花
眼角桃花 2021-01-12 15:25

I\'m trying to move the caret in a Flex TextArea to the end after appending some text from my code. I\'ve looked through the reference documentation for TextArea and its und

6条回答
  •  一个人的身影
    2021-01-12 16:08

    @Paul Stewart verticalScrollPosition is a property not a method so you have to use it similar to a field, like:

    var newPosition:NUmber = 1;
    textArea.verticalScrollPosition = newPosition;
    

    The advantage of using it over a selectionBeginIndex/selectionEndIndex is there you do not have to set a foucus.

提交回复
热议问题