Flash 8 Documentation |
|||
| Components Language Reference > Label component > 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);
|
NOTE |
|
The code |
There are no methods exclusive to the Label 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.
|
Method |
Description |
|---|---|
|
Creates an object on the specified class. |
|
|
Creates a subobject on an object. |
|
|
Destroys a component instance. |
|
|
Calls a function when parameters have been set in the Property and Component inspectors. |
|
|
Gets the style property from the style declaration or object. |
|
|
Marks the object so it is redrawn on the next frame interval. |
|
|
Moves the object to the requested position. |
|
|
Forces validation of the object so it is drawn in the current frame. |
|
|
Resizes the object to the requested size. |
|
|
Sets a skin in the object. |
|
|
Sets the style property on the style declaration or object. |
The following table lists properties of the Label class.
|
Property |
Description |
|---|---|
|
A string that indicates how a label sizes and aligns to fit the value of its |
|
|
A Boolean value that indicates whether a label can be formatted with HTML ( |
|
|
The text on the label. |
The following table lists the properties the Label class inherits from the UIObject class. When you access these properties, use the form labelInstance.propertyName.
|
Property |
Description |
|---|---|
|
The position of the bottom edge of the object, relative to the bottom edge of its parent. Read-only. |
|
|
The height of the object, in pixels. Read-only. |
|
|
The left edge of the object, in pixels. Read-only. |
|
|
The position of the right edge of the object, relative to the right edge of its parent. Read-only. |
|
|
A number indicating the scaling factor in the x direction of the object, relative to its parent. |
|
|
A number indicating the scaling factor in the y direction of the object, relative to its parent. |
|
|
The position of the top edge of the object, relative to its parent. Read-only. |
|
|
A Boolean value indicating whether the object is visible ( |
|
|
The width of the object, in pixels. Read-only. |
|
|
The left edge of the object, in pixels. Read-only. |
|
|
The top edge of the object, in pixels. Read-only. |
There are no events exclusive to the Label class.
The following table lists the events the Label class inherits from the UIObject class.
|
Event |
Description |
|---|---|
|
Broadcast when an object is about to draw its graphics. |
|
|
Broadcast when an object's state changes from visible to invisible. |
|
|
Broadcast when subobjects are being created. |
|
|
Broadcast when the object has moved. |
|
|
Broadcast when an object has been resized. |
|
|
Broadcast when an object's state changes from invisible to visible. |
|
|
Broadcast when the subobjects are being unloaded. |
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00003690.html