User Guide

60 Accordion component (Flash Professional only)
Example
The following code gets a reference to the last header of my_acc and displays the label in the
Output panel:
import mx.core.View;
// Create child panels for each form to be displayed in my_acc object.
my_acc.createChild(View, "shippingAddress", {label: "Shipping Address"});
my_acc.createChild(View, "billingAddress", {label: "Billing Address"});
my_acc.createChild(View, "payment", {label: "Payment"});
var head3:Object = my_acc.getHeaderAt(2);
trace(head3.label);
Accordion.numChildren
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
accordionInstance.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
my_acc.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
my_acc.numChildren would be 7. The result of 7 - 1 is 6,
which is the index number of the last child.