Hi,

I have a Problem with an TextArea.

I want to limit the possible Text in a TextArea like this:

private var lastValidHTMLText:String = "";

private function checkHeight():void
{
        validateNow();
        if (addressText.textHeight < addressText.height )
        {
              lastValidHTMLText = addressText.htmlText; 
        }
        else
        {                                                       
                addressText.htmlText = lastValidHTMLText;
        }
}

<mx:TextArea id="addressText" verticalScrollPolicy="off" 
change="checkHeight();" />

But if the Text reach the limit and after reseting the HTML Text (else{}) there 
is always a extra line break. The line break is not visible in the HTML. But in 
the addressText.text attribute there is an extra \r at the end. 
Because of the extra line break the whole TextArea scroll down and the first 
line is not visible anymore.

Any Ideas?

Thanks!

Reply via email to