Packageqnx.fuse.ui.text
Classpublic class Label
InheritanceLabel Inheritance UIComponent Inheritance flash.display.MovieClip
Implements ILayoutElement

The Label class displays formatted text. The Label class cannot recieve focus and cannot be used for input.

See also

TextInput


Public Properties
 PropertyDefined By
  autoSize : String
Gets or sets a String that indicates how a label is sized and aligned to fit the value of its text property.
Label
  embedFonts : Boolean
Gets or sets the embedFonts property of the internal TextField of the label.
Label
 InheritedexplicitHeight : Number
[read-only]
UIComponent
 InheritedexplicitWidth : Number
[read-only]
UIComponent
  format : TextFormat
Gets or sets the TextFormat object of the label.
Label
  htmlText : String
Gets or sets the html text of the label
Label
 InheritedincludeInLayout : Boolean
Specifies if the component should be included in it's parent containers layout.
UIComponent
 InheritedlayoutData : Object
Returns the layout data for the object.
UIComponent
 InheritedminHeight : Number
Sets the minimum preferred height of the control.
UIComponent
 InheritedminWidth : Number
Sets the minimum preferred width of the control.
UIComponent
  multiline : Boolean
Gets or sets a Boolean that determines whether or not the TextField supports multiline display.
Label
  preferredWrappingPoint : Number
Label
  removeGutters : Boolean
Label
  selectable : Boolean
Gets or sets a Boolean that determines whether or not the text can be selected.
Label
  text : String
Gets or sets the text of the label.
Label
  textField : TextField
[read-only] Gets a reference to the internal textField of the label.
Label
  textHeight : Number
[read-only] Returns the height of the label text (in pixels).
Label
  textWidth : Number
[read-only] Returns the width of the label text (in pixels).
Label
  truncationMode : String
Gets or sets the truncationMode of the label.
Label
  wordWrap : Boolean
Gets or sets a Boolean that determines whether or not the label supports word wrapping.
Label
Protected Properties
 PropertyDefined By
 InheriteddisplayListIsInvalid : Boolean = false
UIComponent
 InheritedpropertiesAreInvalid : Boolean = false
UIComponent
 InheritedsizeChange : Boolean
UIComponent
 InheritedstateChanged : Boolean
UIComponent
Public Methods
 MethodDefined By
  
Creates a new Label instance.
Label
 Inherited
childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner that may affect this object's layout.
UIComponent
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
  
getLineMetrics(index:int):TextLineMetrics
Temporary method to layout text correctly.
Label
  
[override]
Label
 Inherited
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered.
UIComponent
 Inherited
Calling this method results in a call to the components validateProperties() method before the display list is rendered.
UIComponent
 Inherited
measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
UIComponent
 Inherited
setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting the explicitWidth and explicitHeight.
UIComponent
 Inherited
setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified by the arguments.
UIComponent
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
 Inherited
Validates the display list of the component by calling the updateDisplayList().
UIComponent
 Inherited
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.
UIComponent
 Inherited
Validates the properties of the component by calling the commitProperties() method.
UIComponent
Protected Methods
 MethodDefined By
 Inherited
Process properties of the component.
UIComponent
 Inherited
Process the state of the component.
UIComponent
  
doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
[override]
Label
  
flushCache():void
[override]
Label
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
 Inherited
Invalidates the parent's size and display list if includeInLayout property is set to true.
UIComponent
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override]
Label
Property Detail
autoSizeproperty
autoSize:String

Gets or sets a String that indicates how a label is sized and aligned to fit the value of its text property.

The following are valid values:

The default value is The default value is TextFieldAutoSize.NONE.


Implementation
    public function get autoSize():String
    public function set autoSize(value:String):void
embedFontsproperty 
embedFonts:Boolean

Gets or sets the embedFonts property of the internal TextField of the label. When set to false, fonts are rendered as device fonts. When set to true, you must specify a font using the font property of a TextFormat object and set it to the format property. This font must be included in the in your application. If it is not included, the text will not be rendererd.

The default value is false.


Implementation
    public function get embedFonts():Boolean
    public function set embedFonts(value:Boolean):void
formatproperty 
format:TextFormat

Gets or sets the TextFormat object of the label.

The TextFormat object is used to format and style the text of the label. The label has the following default text format:

The following listing creates a TextFormat object and applies it to a Label instance:

        var labelFormat:TextFormat = new TextFormat();
        labelFormat.size = 22;
        
        firstLabel = new Label();
        firstLabel.format = labelFormat;
        firstLabel.text = "First label";
        


Implementation
    public function get format():TextFormat
    public function set format(value:TextFormat):void
htmlTextproperty 
htmlText:String

Gets or sets the html text of the label


Implementation
    public function get htmlText():String
    public function set htmlText(value:String):void
multilineproperty 
multiline:Boolean

Gets or sets a Boolean that determines whether or not the TextField supports multiline display.


Implementation
    public function get multiline():Boolean
    public function set multiline(value:Boolean):void
preferredWrappingPointproperty 
preferredWrappingPoint:Number


Implementation
    public function get preferredWrappingPoint():Number
    public function set preferredWrappingPoint(value:Number):void
removeGuttersproperty 
removeGutters:Boolean


Implementation
    public function get removeGutters():Boolean
    public function set removeGutters(value:Boolean):void
selectableproperty 
selectable:Boolean

Gets or sets a Boolean that determines whether or not the text can be selected.


Implementation
    public function get selectable():Boolean
    public function set selectable(value:Boolean):void
textproperty 
text:String

Gets or sets the text of the label.


Implementation
    public function get text():String
    public function set text(value:String):void
textFieldproperty 
textField:TextField  [read-only]

Gets a reference to the internal textField of the label.

This is a helper method in order to gain more access to the internal textField of the label. However, it is strongly recommended that you limit the use of this method to set or get values of the textField. Instead you should use the public methods of the Label class itself. As an example you should always use Label.textWidth and Label.textHeight instead of accessing these properties on the textField property, as the textField.textWidth value could change if the text has been truncated.


Implementation
    public function get textField():TextField
textHeightproperty 
textHeight:Number  [read-only]

Returns the height of the label text (in pixels).


Implementation
    public function get textHeight():Number
textWidthproperty 
textWidth:Number  [read-only]

Returns the width of the label text (in pixels).


Implementation
    public function get textWidth():Number
truncationModeproperty 
truncationMode:String

Gets or sets the truncationMode of the label.

Valid values can be found in the TextTruncationMode class.

Truncating text will only occur when setting the text property of the label. Truncation will not occur on the htmlText property.

The default value is TextTruncationMode.TRUNCATE_TAIL.


Implementation
    public function get truncationMode():String
    public function set truncationMode(value:String):void

See also

com.ui.text.TextTruncationMode
wordWrapproperty 
wordWrap:Boolean

Gets or sets a Boolean that determines whether or not the label supports word wrapping.


Implementation
    public function get wordWrap():Boolean
    public function set wordWrap(value:Boolean):void
Constructor Detail
Label()Constructor
public function Label()

Creates a new Label instance.

Method Detail
doMeasure()method
override protected function doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement

Parameters

availableWidth:Number
 
availableHeight:Number

Returns
LayoutMeasurement
flushCache()method 
override protected function flushCache():void

getLineMetrics()method 
public function getLineMetrics(index:int):TextLineMetrics

Temporary method to layout text correctly. This will change once we go to FTE.

Parameters

index:int

Returns
TextLineMetrics
getSizeOptions()method 
override public function getSizeOptions():int

Returns
int
updateDisplayList()method 
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Parameters

unscaledWidth:Number
 
unscaledHeight:Number