| Methods | Properties | Effects | Events | Styles | Examples | Frames | No Frames |
The TextArea control is a multiline text field with a border and optional scroll bars. All text in a TextArea control must use the same styling unless it is HTML text. The TextArea control supports the HTML rendering capabilities of Macromedia Flash Player. The TextArea control broadcasts a change event.
If you disable a TextArea control, it displays contents in a different color, represented by the disabledColor style. You can set a TextArea control to read-only to disallow editing of the text. To conceal input text by displaying characters as asterisks, you set the TextArea's password property.
MXML Syntax
The <mx:TextArea> tag inherits all the properties of its parent classes, and the following properties:
<mx:TextAreaClick here to view the Examples
editable="true|false"
hPosition="Always 0 when wordwrap is set to true."
hScrollPolicy="auto|on|off"
htmlText="No default."
maxChars="undefined"
maxHPosition="Always 0 when wordwrap is set to true."
maxVPosition="0"
password="false|true"
restrict="null"
text="No default."
vPosition="0"
vScrollPolicy="auto|on|off"
wordWrap="false|true"
change="Event handler; no default."
/>
See Also
TextInput
| Methods |
| Methods inherited from class mx.core.ScrollView |
childLoaded
createChildren
createChildWithStyles
getViewMetrics
init
layoutChildren
setScrollProperties
|
| Methods inherited from class mx.core.UIComponent |
drawFocus
getFocus
getFocusManager
setEnabled
setFocus
|
| Properties | |
| className:
StringName of this class. |
| editable:
BooleanIf true, the user can edit the text. |
| hPosition:
NumberPixel position of the leftmost character that is currently displayed. |
| hScrollPolicy:
StringWhether the horizontal scroll bar is always on, on, always off, off, turns on when needed, or auto. |
| htmlText:
StringContains HTML formatted text. |
| length:
Number
[Read-Only]
Length of text in the TextArea. |
| maxChars:
NumberMaximum number of characters that the text field can contain. |
| maxHPosition:
Number
[Read-Only]
Maximum value of hPosition. |
| maxVPosition:
Number
[Read-Only]
Maximum value of vPosition. |
| password:
BooleanIf true, the field is a password field. |
| restrict:
StringSet of characters that a user can enter into the text field. |
| tabIndex:
NumberTab order for navigating with the Tab key. |
| text:
StringText string that appears in the control. |
static | version:
StringVersion string for this class. |
| vPosition:
NumberLine number of the top row of characters that is currently displayed. |
| vScrollPolicy:
StringWhether the vertical scroll bar is always on, on, never on, off, or turns on when needed auto. |
| wordWrap:
BooleanIf true, the text wraps. |
| Properties inherited from class mx.core.ScrollView |
className
hPosition
hScrollPolicy
liveScrolling
maxHPosition
maxVPosition
scrollTipFunction
showScrollTips
version
vPosition
vScrollPolicy
|
| Properties inherited from class mx.core.View |
baselinePosition
className
numChildren
version
|
| Properties inherited from class mx.core.UIComponent |
enabled
errorString
tabEnabled
tabIndex
version
|
| Effects |
| Effects inherited from class mx.core.UIComponent |
focusInEffect
focusOutEffect
|
| Effects inherited from class mx.core.UIObject |
creationCompleteEffect
hideEffect
mouseDownEffect
mouseOutEffect
mouseOverEffect
mouseUpEffect
moveEffect
resizeEffect
showEffect
|
| Events | |
change | Broadcast when text in the TextArea control changes. The target property of the event object contains a reference to the component that triggered the event. The type property of the event object contains the name of the event, change. |
| Events inherited from class: mx.core.ScrollView |
scroll |
| Events inherited from class: mx.core.View |
childCreated childDestroyed childIndexChanged |
| Events inherited from class: mx.core.UIComponent |
focusIn focusOut invalid keyDown keyUp valid valueCommitted |
| Styles | |
disabledColor |
Type:
Number
Format:
Color
CSS Inheritance:
yesDisabled color of the TextArea. |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
horizontalGap
leading
marginLeft
marginRight
textAlign
textDecoration
textIndent
verticalGap
|
| Property Detail |
className:
String
editable:
Boolean
true, the user can edit the text. The default value is true.
hPosition:
Number
wordWrap is set to true.
hScrollPolicy:
String
on, always off, off, turns on when needed, or auto. The default value is auto.
htmlText:
String
Note: The htmlText property ignores CSS style settings for the control, and instead relies on the HTML tags in the string for formatting.
Thus, style attributes such as color, fontSize, and fontFamily are ignored.
length:
Number
[Read-Only]
maxChars:
Number
undefined.
maxHPosition:
Number
[Read-Only]
hPosition. The default value is 0. This property is always set to 0 if wordWrap is set to true.
maxVPosition:
Number
[Read-Only]
vPosition. The default value is 0.
password:
Boolean
true, the field is a password field. The default value is false. If you set this property to true, each text character entered into the control appears as the character " ".
restrict:
String
restrict property is null or an empty string, you can enter any character. This property only restricts user interaction; a script can put any text into the text field. If the value of the restrict property is a string of characters, you can enter only characters in that string into the text field. restrict property, you must use the backslash character to specify the literal characters -, ^, and \, as in the following:
tabIndex:
Number
text:
String
If you wish to display text that contains HTML tags then you should use the htmlText property instead.
static
version:
String
vPosition:
Number
vScrollPolicy:
String
on, never on, off, or turns on when needed auto. The default value is auto.
wordWrap:
Boolean
true, the text wraps. The default value is true.
| Examples |
| TextAreaExample.mxml |
|
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/15/asdocs_en/mx/controls/TextArea.html