Adobe help says that
If the new text exceeds the capacity of a TextArea control and the horizontalScrollPolicy property is set to true (the default value), the control adds a scrollbar.
if you want vertical scrollbar then use verticalScrollPolicy....
In <s:textarea> auto scrolling fail.... then just add property <......verticalScrollPolicy="auto"......> n if it is not working then use <...........verticalScrollPolicy="true".............> nothing else u have to add in that textarea . and u can add verticalScrollPosition...
wish it will helpful for u...
k........ see u should remove all the other prop. related to scroll and just add verticalScrollPolicy and verticalScrollPosition nothing else .. it should work ......i tried your example and its working ........ then also try this way..... or send me that whole textarea tag.... but i think this will solve your problem....
and if u are giving "\n" in input text then remove that one also.. just add these two property to textarea and in textinput use textinput event and show that input in textarea... it should work... let's see..... i hope it will work...
XXXxxx2 is right.
I believe his approach would work on any IViewPort based component other than RichEditableText but RET is just borderline insane.
The amount of understanding an application developer has to have to make this work is just too high; It's even worse than that since to make this work there is a litle hack involved that depends a lot on RET's implementation, that is, if you want to set the value to the maximum all during one invalidation so that you see no jumps ( which would be crap )
The biggest issue is how convoluted RET can be and that there isn't enough easier hooks available to developers:
Because range->set value and range->set maximum don't dispatch events ( even undocumented, magic string typed ones would be fine ) I have to listen to viewPort's contentHeight change events. But then it goes like this:
_ viewport contentHeight changed
_ Therefore the scrollbar maximum is changed by the framework
_ I set scrollbar value to its maximum
_ in scrollbar commitProperties, my value is retained, great !
_ in that same commitProperties, the verticalPosition on viewPort is updated as expected
_ A bit later, in RET commitProperties a viewPort's contentHeight is dispatched again because TextContainerManager does some crazy stuffs
_ Therefore the framework changes the scrollbar maximum again...
_ So I try to set the value to equal the maximum again...
_ Then big fail, the next line in RET commitproperties (just after the above event dispatching ) just override the value I just set with the old one.
So please, dispatch more events in setters, even undocumented ones, even if they don't trigger any bindings. You can even check if there are any listeners before dispatching as you did in other places.
That or simplify RET, I don't know why TLF might decide to update the contentHeight if I just changed the vertical position. I'm really expecting just one contentHeight PropertyChange event when the content of the RET changed.
Did you find a solution ?
I'm interested because I have the same problem...
Yes, I simply updated the SDK to the newest version and used this code:
textMessages.scroller.verticalScrollBar.value = textMessages.scroller.verticalScrollBar.maximum;
add these line after the text property of textarea is updated
textarea.scrollToRange(int.MAX_VALUE - 1,int.MAX_VALUE);
textarea..scroller.verticalScrollBar.value = textarea.scroller.verticalScrollBar.maximum ;
Use "appendtext" property in the textarea flex 4.5
when u enter the text and press enter key in the enter key function you have to use appendText
messageArea is the id of the text area
msg is the variable which contains the value from the text box