User Guide

Label component 445
Using skins with the Label component
The Label component does not have any visual elements to skin.
Label class
Inheritance MovieClip > UIObject class > Label
ActionScript Class Name mx.controls.Label
The properties of the Label class allow you at runtime to specify text for the label, indicate
whether the text can be formatted with HTML, and indicate whether the label auto-sizes to fit
the text.
Setting a property of the Label class with ActionScript overrides the parameter of the same name
set in the Property inspector or Component inspector.
Each component class has a
version property, which is a class property. Class properties are
available only on the class itself. The
version property returns a string that indicates the version
of the component. To access this property, use the following code:
trace(mx.controls.Label.version);
Note: The code
trace(myLabelInstance.version); returns undefined.
Method summary for the Label class
There are no methods exclusive to the Label class.
Methods inherited from the UIObject class
The following table lists the methods the Label class inherits from the UIObject class. When
calling these methods from the Label object, use the form
labelInstance.methodName.
fontSize
Both The point size for the font. The default value is 10.
fontStyle
Both The font style: either "normal" or "italic". The default value
is
"normal".
fontWeight
Both The font weight: either "none" or "bold". The default value
is
"none". All components can also accept the value "normal"
in place of "none" during a setStyle() call, but subsequent
calls to
getStyle() will return "none".
textAlign
Both The text alignment: either "left", "right", or "center". The
default value is
"left".
textDecoration
Both The text decoration: either "none" or "underline". The default
value is
"none".
Method Description
UIObject.createClassObject() Creates an object on the specified class.
UIObject.createObject() Creates a subobject on an object.
Style Theme Description