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.

NOTE

A Label component is supported for both ActionScript 2.0 and ActionScript 3.0. This document discusses the version 2 component. If you are using the version 3 component, see Using the Label in Using ActionScript 3.0 Components.

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 the component has. For more information, see "Creating accessible content" in Using Flash.

Related topics