User Guide

Creating the ActionScript class file 171
8. Open StandardComponents.fla as an external library, and drag the UIComponent movie
clip to the Stage on the second frame of the Shape movie clip (with circle_skin).
9. Close StandardComponents.fla.
10. Select the Shape movie clip in the library, select Component Definition from the Library
context menu (Windows: Right-click, Mac: control-click), and enter the AS 2.0 class
name Shape.
11. Test the movie clip with the Shape component on the Stage.
To change the theme color, set the style on the instance. The following code changes the
color of a Shape component with the instance name
shape to red:
shape.setStyle("themeColor",0xff0000);
12.
Draw a square on the Stage and convert it to a movie clip.
Enter the linkage name square_skin, and make sure the Export in First Frame check box
is selected.
13. Open the square_skin movie clip and place the following ActionScript on Frame 1 to
register the symbol with the style name
themeColor:
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
14.
Place the following code on the instance of the Shape component on the Stage in the main
Timeline:
onClipEvent(initialize){
themeShape = "square_skin";
}
15.
Test the movie clip with Shape on the Stage. The result should display a red square.
NOTE
Because the movie clip isn’t placed in the component, Export in First Frame must be
selected so that the skin is available before initialization.