Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Accordion component > Accordion.getChildAt() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
accordionInstance.getChildAt(index)
index The index number of an accordion child. Each child 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 child at the specified index. 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 following code gets a reference to the last child of my_acc and changes the label to "Last Child":
import mx.core.View; // Create child panels with instances of the View class. my_acc.createSegment(View, "myMainItem1", "Menu Item 1"); my_acc.createSegment(View, "myMainItem2", "Menu Item 2"); my_acc.createSegment(View, "myMainItem3", "Menu Item 3"); // Get reference for last child object. var lastChild_obj:Object = my_acc.getChildAt(my_acc.numChildren - 1); // Change label of object. lastChild_obj.label = "Last Child";
Flash CS3