Solved

flex 4 textarea always show bottom

Posted on 2011-03-17
6
881 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 500 total points
ID: 35162157
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now