User Guide

List component 475
List.rowCount
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
listInstance.rowCount
Description
Property; the number of rows that are at least partially visible in the list. This is useful if youve
scaled a list by pixel and need to count its rows. Conversely, setting the number of rows
guarantees that an exact number of rows will be displayed, without a partial row at the bottom.
The code
myList.rowCount = num is equivalent to the code
myList.setSize(myList.width, h) (where h is the height required to display num items).
The default value is based on the height of the list as set during authoring, or set by the
list.setSize() method (see UIObject.setSize()).
Example
The following example discovers the number of visible items in a list:
var rowCount = myList.rowCount;
The following example makes the list display four items:
myList.rowCount = 4;
This example removes a partial row at the bottom of a list, if there is one:
myList.rowCount = myList.rowCount;
This example sets a list to the smallest number of rows it can fully display:
myList.rowCount = 1;
trace("myList has "+myList.rowCount+" rows");
List.rowHeight
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
listInstance.rowHeight