ActionScript 2.0 Components Language Reference |
|
|
|
| List component | |||
The List component is a scrollable single- or multiple-selection list box. A list can also display graphics, including other components. You add the items displayed in the list by using the Values dialog box that appears when you click in the labels or data parameter fields. You can also use the List.addItem() and List.addItemAt() methods to add items to the list.
|
NOTE |
A List 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 List in Using ActionScript 3.0 Components. |
The List component uses a zero-based index, where the item with index 0 is the top item displayed. When adding, removing, or replacing list items using the List class methods and properties, you may need to specify the index of the list item.
The list receives focus when you click it or tab to it, and you can then use the following keys to control it:
|
Key |
Description |
|---|---|
|
Alphanumeric keys |
Jump to the next item that has |
|
Control |
Toggle key that allows multiple noncontiguous selections and deselections. |
|
Down Arrow |
Selection moves down one item. |
|
Home |
Selection moves to the top of the list. |
|
Page Down |
Selection moves down one page. |
|
Page Up |
Selection moves up one page. |
|
Shift |
Allows for contiguous selection. |
|
Up Arrow |
Selection moves up one item. |
|
NOTE |
The page size used by the Page Up and Page Down keys is one less than the number of items that fit in the display. For example, paging down through a ten-line drop-down list shows items 0-9, 9-18, 18-27, and so on, with one item overlapping per page. |
For more information about controlling focus, see FocusManager class or Creating custom focus navigation in Using ActionScript 2.0 Components.
A live preview of each List instance on the Stage reflects changes made to parameters in the Property inspector or Component inspector during authoring.
When you add the List 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.ListAccImpl.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.
|
|
|
|