Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

flex 4 textarea always show bottom

Posted on 2011-03-17
6
Medium Priority
?
890 Views
Last Modified: 2012-05-11
IN Flex 4

I add and add texts,
 
I want to always show the last text
so the text box will need to be scrolled to the bottom.



0
Comment
Question by:yahoolane
  • 5
6 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 35162065
why you cannot try something like this

textArea.text =  label.text + NEXT_STR;
textArea.scrollPosition = textArea.maxScrollPosition;
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35162098
Enter text into TextField and press ENTER

private function onChange(event:Event):void{
      txtArea.text += txtInput.text + "\n";
      txtArea.verticalScrollPosition = txtArea.maxVerticalScrollPosition;
     txtInput.text = "";
}
      <mx:TextInput id="txtInput" enter="onChange(event)"/>
      <mx:TextArea id="txtArea"/>
0
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 35162157
0
Enhanced Intelligibility Without Cable Clutter

Challenge: The ESA office in Brussels wanted a reliable audio conference system for video conferences. Their requirement - No participant must be left out from the conference and the audio quality must not be compromised.

 
LVL 1

Author Comment

by:yahoolane
ID: 35162258
No Joy

1119: Access of possibly undefined property maxScrollPosition through a reference with static type spark.components:TextArea

1119: Access of possibly undefined property scrollPosition through a reference with static type spark.components:TextArea.

Remember I am using Flex 4
.      
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35162314
In this case you just need to use scrollToRange function

private function onChange(event:Event):void{
    txtArea.text += txtInput.text + "\n";
    txtArea.scrollToRange(int.MAX_VALUE);
    txtInput.text = "";
}
      <s:TextInput id="txtInput" enter="onChange(event)"/>
      <s:TextArea id="txtArea" height="100"/>
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35173068
Hi yahoolane,
Please can you accept my answer.
I gave you two solutions for SDK 3 and 4.
Thanks,
David
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
Integration Management Part 2
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question