User Guide
46 Accordion component (Flash Professional only)
To create movie clip symbols for Accordion header skins:
1. Create a new FLA file.
2. Create a new symbol by selecting Insert > New Symbol.
3. Set the name to RedAccordionHeaderSkin.
4. If the advanced view is not displayed, click the Advanced button.
5. Select Export for ActionScript.
The identifier is automatically filled out with
RedAccordionHeaderSkin.
6. Leave the AS 2.0 Class text box blank.
7. Make sure that Export in First Frame is already selected, and click OK.
8. Open the new symbol for editing.
9. Use the drawing tools to create a box with a red fill and black line.
10. Set the border style to hairline.
11. Set the box, including the border, so that it is positioned at (0,0) and has a width and height
of 100.
The ActionScript code sizes the skin as needed.
12. Repeat steps 2-11 and create green and blue skins, named accordingly.
13. Click the Back button to return to the main timeline.
14. Drag an Accordion component to the Stage.
15. Set the Accordion properties so that they display several children.
For example, set
childLabels to an array of [One,Two,Three] and childNames to an
array of
[one,two,three].
16. Copy the following ActionScript code to the Actions panel with the Accordion instance
selected:
onClipEvent(initialize) {
falseUpSkin = "RedAccordionHeaderSkin";
falseDownSkin = "GreenAccordionHeaderSkin";
falseOverSkin = "RedAccordionHeaderSkin";
falseDisabled = "RedAccordionHeaderSkin";
trueUpSkin = "BlueAccordionHeaderSkin";
trueDownSkin = "BlueAccordionHeaderSkin";
trueOverSkin = "BlueAccordionHeaderSkin";
trueDisabledSkin = "BlueAccordionHeaderSkin";
}
17.
Select Control > Test Movie.