User Guide

Accordion component (Flash Professional only) 111
Description
Method; creates a child for the accordion. The newly created child is added to the end of the list
of children owned by the accordion. Use this method to place views inside the accordion. The
created child is an instance of the class or movie clip symbol specified in the
classOrSymbolName
parameter. You can use the
label and icon parameters to specify a text label and an icon for the
associated accordion header for each child.
The
createSegment() method differs from the createChild() method in that label and icon
are passed directly as parameters, not as properties of an
initalProperties parameter.
When each child is created, it is assigned an index number in the order of creation, and the
numChildren property is increased by 1.
Example
The following example creates an instance of the PaymentForm movie clip symbol named
payment as the last child of myAccordion:
var child = myAccordion.createSegment("PaymentForm", "payment", "Payment",
"payIcon");
child.cardType.text = "Visa";
child.cardNumber.text = "1234567887654321";
The following code creates a child that is an instance of the View class:
var child = myAccordion.createSegment(mx.core.View, "payment", {label:
"Payment", Icon: "payIcon"});
child.cardType.text = "Visa";
child.cardNumber.text = "1234567887654321";
The following code also creates a child that is an instance of the View class, but it uses import to
reference the constructor for the View class:
import mx.core.View
var child = myAccordion.createSegment(View, "payment", {label: "Payment",
Icon: "payIcon"});
child.cardType.text = "Visa";
child.cardNumber.text = "1234567887654321";
Accordion.destroyChildAt()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myAccordion.destroyChildAt(index)
Parameters
index
The index number of the accordion child to destroy. Each child of an accordion is
assigned a zero-based index number in the order in which it was created.