Creating skins for some instances

You can create a skin for some instances of a component using the following general procedure:

The following procedure creates a new selectedDownSkin for one of two Button instances.

To create a new selectedDownSkin for a Button:

  1. Create a new Flash file (ActionScript 3.0) document.
  2. Drag two Buttons from the Components panel onto the Stage and give them instance names of aButton and bButton.
  3. Open the Library panel and then the Component Assets and ButtonSkins folders within it.
  4. Click the selectedDownSkin skin to select it.
  5. Right-click to open the context menu and select Duplicate.
  6. In the Duplicate Symbol dialog box, give the new skin a unique name, for example Button_mySelectedDownSkin. Then click OK.
  7. In the Library > Component Assets > ButtonSkins folder, select Button_mySelectedDownSkin and right-click to open the context menu. Select Linkage to open the Linkage Properties dialog box.
  8. Click the Export For ActionScript check box. Leave the Export In First Frame check box selected and ensure that the class name is unique. Click OK, and then click OK again in response to the warning that says a class definition could not be found and one will be created.
  9. Double-click the Button_mySelectedDownSkin skin in the Library panel to open it in symbol-editing mode.
  10. Click the blue fill in the center of the skin until the color appears in the Fill color picker in the Property inspector. Click the color picker and select color #00CC00 for the skin fill.
  11. Click the Back button at the left side of the edit bar above the Stage to return to document-editing mode.
  12. In the Property inspector, click the Parameters tab for each button and set the toggle parameter to true.
  13. Add the following code to the Actions panel on Frame 1 of the Timeline:
    bButton.setStyle("selectedDownSkin", Button_mySelectedDownSkin);
    bButton.setStyle("downSkin", Button_mySelectedDownSkin);
    
  14. Select Control > Text Movie.
  15. Click each button. Note that the down skin (selected and unselected) for the bButton object uses the new skin symbol.