User Guide
Label class 755
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.
When you access the values of label properties, make sure the component has finished loading
before you try to access the desired property. Consider the following example:
var listenerObject:Object = new Object();
listenerObject.load = function(){
trace(label.width);
};
label.addEventListener("load", listenerObject);
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);
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.
NOTE
The code trace(myLabelInstance.version); returns undefined.
Method Description
UIObject.createClassObject() Creates an object on the specified class.
UIObject.createObject() Creates a subobject on an object.
UIObject.destroyObject() Destroys a component instance.