Packagexp.controls
Classpublic class XPLabel
InheritanceXPLabel Inheritance mx.controls.Label
SubclassesSeparator

The Text control displays multiline, noneditable text. Use the Label control if you need only a single line of text.

The Text control does not support scroll bars. If you need scrolling, you should use a non-editable TextArea control.

You can format the text in a Text control using HTML tags, which are applied after the control's CSS styles are applied. You can also put padding around the four sides of the text.

The text in a Text control is selectable by default, but you can make it unselectable by setting the selectable property to false.

If the control is not as wide as the text, the text will wordwrap. The text is always aligned top-left in the control.

To size a Text component, it's common to specify an explicit width and let Flex determine the height as required to display all the text. If you specify an explicit height, some of the text may get clipped; unlike Label, Text does not truncate its text with "...". It's also common to use percentage widths and heights with Text.

If you leave both the width and the height unspecified, Flex calculates them based on any explicit line breaks in the text, with no wordwrapping within lines. For example, if you set the text property, the newline character "\n" causes a line break. If you set the htmlText property, the HTML markup <br> causes a line break. If your text or htmlText is lengthy and doesn't contain line breaks, you can get a very wide Text component; you can set the maxWidth to limit how wide the component is allowed to grow.

Text controls do not have backgrounds or borders and cannot take focus.

MXML Syntaxexpanded Hide MXML Syntax

The <mx:Text> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:

  <mx:Text
  leading="2"
  />
  

See also

mx.controls.Label
mx.controls.TextInput
mx.controls.TextArea
mx.controls.RichTextEditor


Protected Properties
 PropertyDefined by
  _paddingBottom : Number
XPLabel
  _paddingLeft : Number
XPLabel
  _paddingRight : Number
XPLabel
  _paddingTop : Number
XPLabel
Public Methods
 MethodDefined by
  
Constructor.
XPLabel
  
styleChanged(styleProp:String):void
XPLabel
Protected Methods
 MethodDefined by
  
drawLabel(unscaledWidth:Number, unscaledHeight:Number):void
XPLabel
Styles
 StyleDescriptionDefined by
  
leading
Type: Number   Format: Length   CSS Inheritance: no
Additional vertical space between lines of text.

The default value is 2.

The default value for the ComboBox control is 0.

XPLabel
Property detail
_paddingBottomproperty
protected var _paddingBottom:Number
_paddingLeftproperty 
protected var _paddingLeft:Number
_paddingRightproperty 
protected var _paddingRight:Number
_paddingTopproperty 
protected var _paddingTop:Number
Constructor detail
XPLabel()constructor
public function XPLabel()

Constructor.

Method detail
drawLabel()method
protected function drawLabel(unscaledWidth:Number, unscaledHeight:Number):voidParameters
unscaledWidth:Number
 
unscaledHeight:Number
styleChanged()method 
public override function styleChanged(styleProp:String):voidParameters
styleProp:String