Solved

flex 4 textarea always show bottom

Posted on 2011-03-17
6
884 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 total points
ID: 35162157
0
Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

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…
Configuring Remote Assistance for use with SCCM
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 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