User Guide
110 Chapter 6: Components Dictionary
Example
The following code creates an instance of the PaymentForm movie clip symbol named payment as
the last child of
myAccordion:
var child = myAccordion.createChild("PaymentForm", "payment", {label:
"Payment", Icon: "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.createChild(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.createChild(View, "payment", {label: "Payment", Icon:
"payIcon"});
child.cardType.text = "Visa";
child.cardNumber.text = "1234567887654321";
Accordion.createSegment()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myAccordion.createSegment(classOrSymbolName, instanceName[, label[, icon]])
Parameters
classOrSymbolName
Either a reference to the constructor function for the class of the
UIObject to be instantiated, or the linkage name of the symbol to be instantiated. The class must
be UIObject or a subclass of UIObject, but most often it is View or a subclass of View.
instanceName The instance name of the new instance.
label A string that specifies the text label that the new child instance uses on its header. This
parameter is optional.
icon A string reference to the linkage identifier of the library symbol that the child uses for the
icon on its header. This parameter is optional.
Returns
A reference to the newly created UIObject instance.