Using movie clips to customize the Accordion header skin

The example above demonstrates how to use an ActionScript 2.0 class to customize the Accordion header skin, which is the method used by the skins provided in both the Halo and Sample themes. However, because the example uses simple colored boxes, it is simpler in this case to use different movie clip symbols as header skins.

To create movie clip symbols for Accordion header skins:

  1. Select File > New and choose Flash File (ActionScript 2.0).
  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 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.