The old method for the mx:TextArea no longer works. Specifically:
myMxTextArea.verticalScrollPosition = myMxTextArea.maxVerticalScrollPosition;
I've found this method for Spark but seems a bit kludgy:
mySparkTA.scrollToRange(mySparkTA.text.length-1, mySparkTA.text.length);
Is there a more straightforward way to do this?
Assuming that you have
<s:TextArea id="ta" width="100%" height="100%" />
The following will work:
ta.scroller.verticalScrollBar.value = ta.scroller.verticalScrollBar.maximum;
No need to wrap the TextArea in a Scroller component.
That is how you do with with a spark textarea, but you could always try to wrap it in a Scroller component and not have the textarea itself bother with scrolling:
<s:Scroller id="scroller">
<s:TextArea id="ta" width="100%" height="100%" />
</s:Scroller>
Then doing this in AS:
scroller.verticalScrollBar.value = scroller.verticalScrollBar.maximum;
There's no other easy way to do it.
The spark TextArea has an "appendText" method This appends the text and scrolls automatically down to the line added..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With