User interaction with the List

You can set up a list so that users can make either single or multiple selections. For example, a user visiting an e-commerce website needs to select which item to buy. There are 30 items, and the user scrolls through a list and selects one by clicking it.

You can also design a List that uses custom movie clips as rows so you can display more information to the user. For example, in an e-mail application, each mailbox could be a List component and each row could have icons to indicate priority and status.

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 Key.getAscii() as the first character in its label.

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.

Note also that scroll sizes are in pixels and not rows.

For more information about controlling focus, see the IFocusManager interface and the FocusManager class in the ActionScript 3.0 Language and Components Reference and Working with FocusManager.

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 make it accessible to a screen reader by adding the following lines of ActionScript code:

import fl.accessibility.ListAccImpl;

ListAccImpl.enableAccessibility();

You enable accessibility for a component only once, regardless of how many instances the component has. For more information, see Chapter 18, "Creating Accessible Content," in Using Flash.