View comments | RSS feed

Using the TextArea

The TextArea component is a wrapper for the native ActionScript TextField object. You can use the TextArea component to display text and also to edit and receive text input if the editable property is true. The component can display or receive multiple lines of text and wraps long lines of text if the wordWrap property is set to true. The restrict property allows you to restrict the characters that a user can enter and maxChars allows you to specify the maximum number of characters that a user can enter. If the text exceeds the horizontal or vertical boundaries of the text area, horizontal and vertical scroll bars automatically appear unless their associated properties, horizontalScrollPolicy and verticalScrollPolicy, are set to off.

You can use a TextArea component wherever you need a multiline text field. For example, you could use a TextArea component as a comment field in a form. You could set up a listener that checks whether the field is empty when a user tabs out of the field. That listener could display an error message indicating that a comment must be entered in the field.

If you need a single-line text field, use the TextInput component.

You can set the textFormat style using the setStyle() method to change the style of text that appears in a TextArea instance. You can also format a TextArea component with HTML using the htmlText property in ActionScript, and you can set the displayAsPassword property to true to mask text with asterisks. If you set the condenseWhite property to true, Flash removes extra white space in new text that is due to spaces, line breaks, and so on. It has no effect on text that is already in the control.

Related topics


Flash CS3


Comments


SuJun said on Mar 27, 2008 at 3:02 PM :
I'm trying to find out about the text area component: how to find where it is, how to use it, a tutorial on the text area component. I'm trying to find something that is not geek speak and actually instructs the Flash User. I'm beginning to think basic users are no longer able to use and learn Flash.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000468.html