Label component
A label component is a single line of text. You can specify that a label be formatted with HTML.
You can also control the alignment and size of a label. Label components don't have borders,
cannot be focused, and don't broadcast any events.
A live preview of each Label instance reflects changes made to parameters in the Property
inspector or Component inspector during authoring. The label doesn't have a border, so the only
way to see its live preview is to set its text parameter. The autoSize parameter is not supported in
live preview.
When you add the Label component to an application, you can use the Accessibility panel
to make it accessible to screen readers. First, you must add the following line of code to
enable accessibility:
mx.accessibility.LabelAccImpl.enableAccessibility();
You enable accessibility for a component only once, regardless of how many instances you have of
the component. For more information, see Chapter 17, "Creating Accessible Content," in Using
Flash.
Using the label component
Use a Label component to create a text label for another component in a form, such as a "Name:"
label to the left of a TextInput field that accepts a user's name. If you're building an application
using components based on version 2 of the Macromedia Component Architecture, it's a good
idea to use a Label component instead of a plain text field because you can use styles to maintain
a consistent look and feel.
If you want to rotate a Label component, you must embed the fonts. See
Label component" on page
Label parameters
You can set the following authoring parameters for each Label component instance in the
Property inspector or in the Component inspector:
text
indicates the text of the label; the default value is
html
indicates whether the label is formatted with HTML (
parameter is set to
autoSize
indicates how the label sizes and aligns to fit the text. The default value is
parameter can have any of the following four values:
•
, which specifies that the label doesn't resize or align to fit the text.
none
•
, which specifies that the right and bottom sides of the label resize to fit the text. The left
left
and top sides don't resize.
•
, which specifies that the bottom side of the label resizes to fit the text. The horizontal
center
center of the label stays anchored at its original horizontal center position.
•
, which specifies that the left and bottom sides of the label resize to fit the text. The top
right
and right side don't resize.
444.
, a label cannot be formatted with styles. The default value is
true
Components Dictionary
"Using styles with the
.
Label
) or not (
true
false
Label component
CHAPTER 6
). If this
.
false
. The
none
443
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers