F > FComboBox (component) |
![]() ![]() ![]() |
FComboBox (component)
The ComboBox component in the Flash authoring environment provides drag-and-drop functionality for adding scrollable single-selection drop-down lists to Flash documents; it also provides a user interface for setting basic parameters. The methods of the FComboBox component allow you to control combo boxes at runtime: you can create combo boxes, control combo 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.
The ComboBox component creates both static and editable combo boxes. A static combo box is a scrollable drop-down list that allows users to select items. An editable combo box is a scrollable drop-down list with a text field at the top. You can let users enter text in the text field to make the combo box scroll to the desired item, or you can use the text field to set displayed text at runtime.
Both the static and editable versions of the ComboBox component list items from top to bottom using a zero-based indexing system. If the number of items in the combo box list creates a drop-down list that exceeds the available space below the component, the list opens upward instead of dropping down.
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 ComboBox component is supported by Flash Player 6 and later versions of the Flash Player.
For information on using the ComboBox 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 Description Adds a new item to the end of the combo box list. Adds a new item to the combo box list at the specified index. Returns Returns the item at the specified index as an object with the properties Returns the number of items listed in the combo box. Returns the number of rows visible in the combo box. Returns the index of the item at the top of the combo box. Returns the index of the currently selected item. Returns the currently selected item as an object with the properties Returns the text in the input field for editable combo boxes; returns the label or data of the selected item for static combo boxes. Registers a skin element to a property. Removes all items from the combo box. Removes the item at the specified index. Replaces the label and data of an item at the specified index. Assigns a function to call each time an item is selected or the user enters text in the text field. Registers an outside object to the component as a data source. Determines whether the combo box is editable ( Specifies whether the combo box is enabled ( Registers a symbol linkage ID to use for displaying list items in the combo box. Determines the number of items displayed in the combo box without a scroll bar. Selects the item at the specified index. Sets the pixel width of the combo box. Sets a single style property for an instance of a component. Specifies the text displayed in the text field at the top of an editable combo box. Sorts the items in the list box alphabetically or numerically by label or by data.
Method summary for the FComboBox component
true
if the combo box is enabled, false
if it is disabled.
label
and data
.
label
and data
.
true
) or static (false
).
true
) or disabled (false
).
![]() ![]() ![]() |