Accordion.getChildAt()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

accordionInstance.getChildAt(index)

Parameters

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.

Returns

A reference to the instance of the UIObject at the specified index.

Description

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.

Example

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