Accessibility
Peter Ent

Peter Ent

Adobe

Table of Contents

Created:
January 2005
User Level:
All
Products:
Flex

Flex Component Basics – Part 2: Creating and Applying Graphic or Code-Based Skins to Extend Flex Components

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.

Requirements

To complete this tutorial you will need to install the following software and files:

Flex 1.5

Flash MX 2004

Fireworks MX 2004


Tutorials and sample 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.

Prerequisite knowledge:

Some knowledge of ActionScript

About the author

Peter Ent is a Computer Scientist at Adobe, working on the Genesis project. Prior to this, Peter worked for Adobe Customer Care as a Flex Support Engineer and then as a Technical Account Manager. Before joining Adobe, Peter worked in the financial services industry at State Street and Fidelity Investments. He also has experience at two start-ups building software applications doing imaging and molecular modeling. Peter holds a bachelor of science in Computer Science from Syracuse University. Visit Peter's blog.