User Guide

751
26
CHAPTER 26
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 dont have
borders, cannot be focused, and dont 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 doesnt 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 the
component has. For more information, see Chapter 19, “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 youre building an
application using components based on version 2 of the Macromedia Component
Architecture, its 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 “Using styles with
the Label component” on page 753.