ComboBox.rowCount

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

comboBoxInstance.rowCount

Description

Property; the maximum number of rows visible in the drop-down list before the combo box inserts a scroll bar. The default value is 5.

If the number of items in the drop-down list is greater than the rowCount property, the list resizes and a scroll bar is displayed if necessary. If the drop-down list contains fewer items than the rowCount property, it resizes to the number of items in the list.

This behavior differs from the List component, which always shows the number of rows specified by its rowCount property, even if some empty space is shown.

If the value is negative or fractional, the behavior is undefined.

Example

With a ComboBox component instance my_cb, the following ActionScript sets the combo box to show the first three items, and add a scrollbar to see the fourth:

// Add Items to List.
my_cb.addItem({data:1, label:"First Item"});
my_cb.addItem({data:2, label:"Second Item"});
my_cb.addItem({data:3, label:"Third Item"});
my_cb.addItem({data:4, label:"Fourth Item"});

// Display scroll bar if ComboBox has more than 3 items.
my_cb.rowCount = 3;