You could for example set up an event listener that listens to the
FlexEvent.UPDATE_COMPLETE event. That one is triggered every time the
TextArea is visually updated (The Change event only fires when using data
binding or interacting with the component) .

 

addEventListener(FlexEvent.UPDATE_COMPLETE, onUpdateComplete);

 

and the triggered method would look like this .

 

private function onUpdateComplete(event:FlexEvent):void

{

       textArea.verticalScrollPosition = textArea.textHeight;

}

 

If you write a custom textArea component and put this code in it, you also
have to use validateNow() at the beginning in the triggered method.

 

Hth,

Sascha

 

 

  _____  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Anderson
Sent: Saturday, 06 January, 2007 16:52
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Automatically scrolling a TextArea to the very bottom?

 

Hello All,

I am trying to find the common methods, when comparing the TextArea from
Flash 8 to the TextArea from Flex 2.0 -

In my Flash App, whenever I wanted to scroll my TextArea all the way to
the bottom, I used the following code:

myTextArea.vPosition = myTextArea.maxVPosition;

I am trying to sift through the Properties and Methods of the Flex
version, and I am not entirely sure how to accomplish this.

Could any of you point me in the right direction?

Thanks in advance for all your help,

Mike

 

Reply via email to