Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Accordion component > Accordion.getHeaderAt() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
accordionInstance.getHeaderAt(index)
index The index number of an accordion header. Each header of an accordion is assigned a zero-based index in the order in which it was created.
A reference to the instance of the UIObject at the specified index.
Method; returns a reference to the header at the specified index. Each accordion header is given an index number for its position. This index number is zero-based, so the first header is 0, the second header is 1, and so on.
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);
Flash CS3