User Guide

Accordion component (Flash Professional only) 109
Example
In the following example, a handler called myAccordionListener is defined and passed to the
myAccordion.addEventListener() method as the second parameter. The event object is
captured by the
change handler in the eventObject parameter. When the change event is
broadcast, a
trace statement is sent to the Output panel.
myAccordionListener = new Object();
myAccordionListener.change = function(){
trace("Changed to different view");
}
myAccordion.addEventListener("change", myAccordionListener);
Accordion.createChild()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myAccordion.createChild(classOrSymbolName, instanceName[, initialProperties])
Parameters
classOrSymbolName
Either the constructor function for the class of the UIObject to be
instantiated, or the linkage name (a reference to the symbol to be instantiated). The class must be
UIObject or a subclass of UIObject, but most often it is View object or a subclass of View.
instanceName The instance name of the new instance.
initialProperties An optional parameter that specifies initial properties for the new
instance. You can use the following properties:
label A string that specifies the text label that the new child instance uses on its header.
icon A string that specifies the linkage identifier of the library symbol that the child uses for
the icon on its header.
Returns
A reference to an instance of the UIObject that is the newly created child.
Description
Method (inherited from View); 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 properties to specify a text label
and an icon for the associated accordion header for each child in the
initialProperties
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.