Solved

flex 4 textarea always show bottom

Posted on 2011-03-17
6
883 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
flex 4.5 upload with java servlet 1 1,063
Adobe Air with Flex on ios 2 1,124
AS3 auto playing child movie clips? 2 635
How width columns automaticaly 4 435
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…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1

821 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