User Guide

Accordion component (Flash Professional only) 113
Accordion.numChildren
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myAccordion.numChildren
Description
Property (inherited from View); indicates the number of children (of type UIObject) in an
Accordion instance. Headers are not counted as children.
Each accordion child is given an index number for its position. This index number is zero-based,
so the first child is 0, the second child is 1, and so on. The code
myAccordion.numChild - 1
always refers to the last child added to an accordion. For example, if there were seven children in
an accordion, the last child would have the index 6. The
numChildren property is not zero-based,
so the value of
myAccordion.numChildren would be 7. The result of 7 - 1 is 6, which is the
index number of the last child.
Example
The following example selects the last child:
myAccordion.selectedIndex = myAccordion.numChildren - 1;
Accordion.selectedChild
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myAccordion.selectedChild
Description
Property; the selected child (of type UIObject) if one or more children exist; undefined if no
children exist.
If the accordion has children, the code
myAccordion.selectedChild is equivalent to the code
myAccordion.getChildAt(myAccordion.selectedIndex).
Setting this property to a child causes the accordion to begin the transition animation to display
the specified child.
Changing the value of
selectedChild also changes the value of selectedIndex.