User Guide

Accordion.selectedChild 61
Example
The following code uses numChildren to get 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";
Accordion.selectedChild
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
accordionInstance.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
accordionInstance.selectedChild is equivalent to
the code
accordionInstance.getChildAt(accordionInstance.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.
If the accordian has children, the default value is accordionInstance.getChildAt(0). If
the accordion doesnt have children, the default value is
undefined.