User Guide

40 Accordion component (Flash Professional only)
6. In the Actions panel in Frame 1, below the code you entered in step 5, enter the following
code (this code adds two TextInput component instances to the accordions children):
// Create child text input for the shippingAddress panel.
var firstNameChild_obj:Object =
my_acc.shippingAddress.createChild("TextInput", "firstName", {text:
"First Name"});
// Set position of text input.
firstNameChild_obj.move(10, 38);
firstNameChild_obj.setSize(110, 20);
// Create another child text input.
var lastNameChild_obj:Object =
my_acc.shippingAddress.createChild("TextInput", "lastName", {text:
"Last Name"});
// Set position of text input.
lastNameChild_obj.move(150, 38);
lastNameChild_obj.setSize(140, 20);
Customizing the Accordion component
(Flash Professional only)
You can transform an Accordion component horizontally and vertically during authoring and
at runtime. While authoring, select the component on the Stage and use the Free Transform
tool or any of the Modify > Transform commands. At runtime, use the
setSize() method
(see
UIObject.setSize()).
The
setSize() method and the Transform tool change only the width of the accordions
headers and the width and height of its content area. The height of the headers and the width
and height of the children are not affected. Calling the
setSize() method is the only way to
change the bounding rectangle of an accordion.
If the headers are too small to contain their label text, the labels are clipped. If the content area
of an accordion is smaller than a child, the child is clipped.