
In my last article, Flex Component Basics—Part 1: Coding an Analog Clock, you built a basic Flex component using the drawing API to render the graphics. The result was a simple analog clock that showed the time. In this article, you build upon that component and add skins and events to it.
Skins make it possible for a component to take on many looks without changing its intrinsic behavior. Styles are different from skins. You apply styles to skins to customize them even further. In the following sections of this article, you will learn how to create skins in ActionScript and learn how to apply skins made in Macromedia Flash MX 2004.
Events give a component its interactivity. Whether this is with a user or with other components, events make it possible to trigger actions based upon events that occur within the component. In this article, you will also learn how to add events in Flex components by changing the analog clock into a stop watch.
To complete this tutorial you will need to install the following software and files:
This ZIP file contains the sample files for this article. Download and view the files as you follow the steps in this article. This ZIP file also contains the clock component you built in Part 1 of this series.
Some knowledge of ActionScript