mx.controls
Class TextArea



class TextArea
extends mx.core.ScrollView

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:TextArea
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."
scroll="Event handler; no default."
/>

See Also
mx.controls.TextInput



Methods

Methods inherited from class mx.core.ScrollView
setScrollProperties  getViewMetrics  createChild 

Methods inherited from class mx.core.View
init  draw  createChild  getChildAt  getChildIndex  setChildIndex  destroyAllChildren  destroyChild  destroyChildAt  getViewMetrics 

Methods inherited from class mx.core.UIComponent
getFocus  setFocus  getFocusManager 

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
staticversion:String  
ComponentVersion is for internal use only.
      className:String  
Name of this class.
      maxChars:Number   [Read-Write]
Maximum number of characters that the text field can contain.
      length:Number   [Read-Only]
Length of text in the TextArea.
      restrict:String   [Read-Write]
Set of characters that a user can enter into the text field.
      wordWrap:Boolean   [Read-Write]
If true, the text wraps.
      editable:Boolean   [Read-Write]
If true, the user can edit the text.
      password:Boolean   [Read-Write]
If true, the field is a password field.
      text:String   [Read-Write]
Text string that appears in the control.
      htmlText:String   [Read-Write]
Contains HTML formatted text.
      hPosition:Number   [Read-Write]
Pixel position of the leftmost character that is currently displayed.
      vPosition:Number   [Read-Write]
Line number of the top row of characters that is currently displayed.
      maxVPosition:Number   [Read-Only]
Maximum value of vPosition.
      maxHPosition:Number   [Read-Only]
Maximum value of hPosition.
      tabIndex:Number   [Read-Write]
Tab order for navigating with the Tab key.
      hScrollPolicy:String  
Whether the horizontal scroll bar is always on, on, always off, off, turns on when needed, or auto.
      vScrollPolicy:String  
Whether the vertical scroll bar is always on, on, never on, off, or turns on when needed auto.

Properties inherited from class mx.core.ScrollView
version  className  hScrollPolicy  vScrollPolicy  hPosition  vPosition  maxVPosition  maxHPosition 

Properties inherited from class mx.core.View
version  className  numChildren 

Properties inherited from class mx.core.UIComponent
version  enabled  tabIndex 

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


Effects

Effects inherited from class mx.core.UIComponent
showEffect  hideEffect  focusInEffect  focusOutEffect 

Effects inherited from class mx.core.UIObject
creationCompleteEffect  moveEffect  resizeEffect  mouseDownEffect  mouseOverEffect  mouseOutEffect  mouseUpEffect 


Events
changeBroadcast when text in the TextArea control changes. Target contains a reference to the component that triggered the event. Type contains the name of the event.

Events inherited from class: mx.core.ScrollView
scroll 

Events inherited from class: mx.core.View
childCreated  childIndexChanged  childDestroyed 

Events inherited from class: mx.core.UIComponent
focusIn  focusOut  keyDown  keyUp  show  hide  valid  invalid  valueCommitted 

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles
disabledColor Type: Number   Format: Color   CSS Inheritance: yes
Disabled color of the TextArea.

Styles inherited from class mx.core.UIComponent
backgroundColor  backgroundDisabledColor  backgroundImage  backgroundAlpha  backgroundSize  barColor  borderCapColor  borderColor  buttonColor  borderStyle  disabledColor  errorColor  highlightColor  lineHeight  modalTransparency  scrollTrackColor  shadowColor  shadowCapColor  symbolColor  symbolBackgroundColor  symbolBackgroundDisabledColor  symbolBackgroundPressedColor  symbolDisabledColor  themeColor 

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Property Detail

className

className:String  

Name of this class.


editable

editable:Boolean   [Read-Write]

If true, the user can edit the text. The default value is true.


hPosition

hPosition:Number   [Read-Write]

Pixel position of the leftmost character that is currently displayed. This property is always set to 0, and ignores changes, if wordWrap is set to true.


hScrollPolicy

hScrollPolicy:String  

Whether the horizontal scroll bar is always on, on, always off, off, turns on when needed, or auto. The default value is auto.


htmlText

htmlText:String   [Read-Write]

Contains HTML formatted text. If your text string contains HTML tags, you must wrap it in the CDATA tag. The control collapses any white space characters, such as tab and newline characters. For the special characters left angle bracket (<), right angle bracket (>), or ampersand (&), insert the HTML equivalents of &lt;, &gt;, and &amp;. The htmlText property ignores CSS style settings for the control, and instead relies on the HTML tags in the string for formatting.


length

length:Number   [Read-Only]

Length of text in the TextArea.


maxChars

maxChars:Number   [Read-Write]

Maximum number of characters that the text field can contain. The default value is undefined.


maxHPosition

maxHPosition:Number   [Read-Only]

Maximum value of hPosition. The default value is 0. This property is always set to 0 if wordWrap is set to true.


maxVPosition

maxVPosition:Number   [Read-Only]

Maximum value of vPosition. The default value is 0.


password

password:Boolean   [Read-Write]

If 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

restrict:String   [Read-Write]

Set of characters that a user can enter into the text field. If the value of the 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. The string is scanned from left to right. You can specify a range by using the dash (-). If the string begins with ^, the string specifies the characters that may not be entered into the control. For example, the string "^a-z" means all upper case letters may be entered, but no lower case letters are allowed. This property does not synchronize with the Embed Font Outlines check boxes in the Property inspector. Because some characters have a special meaning when used in the restrict property, you must use the backslash character to specify the literal characters -, ^, and \, as in the following:
\^
\-
\\


tabIndex

tabIndex:Number   [Read-Write]

Tab order for navigating with the Tab key.


text

text:String   [Read-Write]

Text string that appears in the control. The control collapses any white-space characters, such as tab and newline characters. Any HTML tags in the text string are ignored, and appear as entered in the string. For the special characters left angle bracket (<), right angle bracket (>), or ampersand (&), wrap the text string in the CDATA tag. If html="false," it contains plain text. If html="true," it contains HTML formatted text, including HTML tags.


version

static version:String  

ComponentVersion is for internal use only.


vPosition

vPosition:Number   [Read-Write]

Line number of the top row of characters that is currently displayed. The default value is 0.


vScrollPolicy

vScrollPolicy:String  

Whether the vertical scroll bar is always on, on, never on, off, or turns on when needed auto. The default value is auto.


wordWrap

wordWrap:Boolean   [Read-Write]

If true, the text wraps. The default value is true.