F > FListBox (component) |  |

FListBox (component)

FListBox, component

The ListBox component in the Flash authoring environment provides drag-and-drop functionality for adding scrollable single-selection and multiple-selection list boxes to Flash documents; it also provides a user interface for setting basic parameters. The methods of the FListBox component allow you to control list boxes at runtime: you can create list boxes, control list boxes created in authoring, set or override basic parameters, and set additional runtime options. You do not need to use a constructor to access the methods of components.

Component methods do not perform error checking for type, as do other native ActionScript objects and actions; therefore, it is recommended that you validate parameters before passing them to methods.

The ListBox component is supported by Flash Player 6 and later versions of the Flash Player.

For information on using the ListBox component, setting parameters during authoring, and changing the color and appearance of components, see Customizing component colors and text and Customizing component skins in the Using Components chapter of Using Flash.

Method summary for the FListBox component

Method | Description
--- | ---
`FListBox.addItem` | Adds a new item to the end of the list box.
`FListBox.addItemAt` | Adds a new item to the list box at the specified index.
`FListBox.getEnabled` | Returns `true` if the list box is enabled, `false` if it is disabled.
`FListBox.getItemAt` | Returns the label and value of the item at the specified index.
`FListBox.getLength` | Returns the number of items in the list box.
`FListBox.getRowCount` | Returns the number of items visible in the list box.
`FListBox.getScrollPosition` | Returns the index of the item at the top of the list box.
`FListBox.getSelectedIndex` | Returns the index of the last selected item.
`FListBox.getSelectedIndices` | Returns the indexes of multiple selected items.
`FListBox.getSelectedItem` | Returns the label and value of the selected item.
`FListBox.getSelectedItems` | Returns the label and value of multiple selected items.
`FListBox.getSelectMultiple` | Returns `true` if multiple selection is allowed, `false` if single selection is allowed.
`FListBox.getValue` | Returns the label of the selected item or any associated data information.
`FListBox.registerSkinElement` | Registers a skin element to a property.
`FListBox.removeAll` | Removes all items from the list box.
`FListBox.removeItemAt` | Removes the item at the specified index.
`FListBox.replaceItemAt` | Replaces the label and data of an item at a specified index with a new label and data.
`FListBox.setAutoHideScrollBar` | Determines whether a scroll bar is hidden (`true`) or displayed (`false`) when the number of items in the list box does not require scrolling.
`FListBox.setChangeHandler` | Assigns a function to call each time the selection changes.
`FListBox.setDataProvider` | Associates an outside object with the list box.
`FListBox.setEnabled` | Specifies whether the list box is enabled (`true`) or disabled (`false`).
`FListBox.setItemSymbol` | Registers a symbol linkage ID to use for displaying items in the list box.
`FListBox.setRowCount` | Determines the number of items displayed in the list box.
`FListBox.setScrollPosition` | Causes the list box to scroll so that the item at the specified index is displayed at the top of the list.
`FListBox.setSelectedIndex` | Selects the item at the specified index and updates the list box.
`FListBox.setSelectedIndices` | Selects the items at the specified indexes and updates the list box.
`FListBox.setSelectMultiple` | Determines whether the user can select more than one item in the list (`true`) or not (`false`).
`FListBox.setSize` | Sets the width and height of the list box, in pixels.
`FListBox.setStyleProperty` | Sets a single style property for a component.
`FListBox.setWidth` | Sets the width of the list box, in pixels.
`FListBox.sortItemsBy` | Sorts the items in the list box alphabetically or numerically using the label or the data.