For the
childNames
These strings are the ActionScript names of the accordion's children.
For the
childLabels
These strings are the text labels on the accordion headers.
For the
childIcons
These strings specify the linkage identifiers of the movie clip symbols that are used as the
icons on the accordion headers. You must create these movie clip symbols if you want icons
in the headers.
Select Control > Test Movie.
9.
To use ActionScript to add children to an Accordion component:
Select File > New and create a Flash document.
1.
Drag an Accordion component from the Components panel to the Stage.
2.
In the Property inspector, enter the instance name myAccordion.
3.
Drag a TextInput component to the Stage and delete it.
4.
This adds the component to the library so that you can dynamically instantiate it in step 6.
In the Actions panel on Frame 1 of the Timeline, enter the following:
5.
myAccordion.createChild("View", "shippingAddress", {label: "Shipping
Address"});
myAccordion.createChild("View", "billingAddress", {label: "Billing
Address"});
myAccordion.createChild("View", "payment", {label: "Payment"});
This code calls the
In the Actions panel on Frame 1, below the code you entered in step 5, enter the following code:
6.
var o = myAccordion.shippingAddress.createChild("TextInput", "firstName");
o.move(20, 38);
o.setSize(116, 20);
o = myAccordion.shippingAddress.createChild("TextInput", "lastName");
o.move(175, 38);
o.setSize(145, 20);
This code adds component instances (two TextInput components) to the accordion's children.
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
UIObject.setSize()
The
setSize()
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
bounding rectangle of an accordion.
property, enter shippingAddress, billingAddress, and checkout.
property, enter Shipping Address, Billing Address, and Checkout.
property, enter AddressIcon, AddressIcon, and CheckoutIcon.
createChild()
).
method and the Transform tool change only the width of the accordion's headers
method to create its child views.
method is the only way to change the
setSize()
Accordion component (Flash Professional only)
method (see
setSize()
99
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?