User Guide
16 Chapter 1: About Components
Version 2 components are included in the Components panel as compiled clip (SWC) symbols. A
compiled clip is a component movie clip whose code has been compiled. Compiled clips cannot
be edited, but you can change their parameters in the Property inspector and Component
inspector, just as you would with any component. For more information, see “About compiled
clips and SWC files” on page 17.
Version 2 components are written in ActionScript 2.0. Each component is a class and each class is
in an ActionScript package. For example, a radio button component is an instance of the
RadioButton class whose package name is mx.controls. For more information about packages, see
“Using packages” in Using ActionScript in Flash.
Most UI components built with version 2 of the Macromedia Component Architecture are
subclasses of the UIObject and UIComponent classes and inherit all properties, methods, and
events from those classes. Many components are also subclasses of other components. The
inheritance path of each component is indicated in its entry in Chapter 6, “Components
Dictionary,” on page 91.
Note: The class hierarchy is also available as a GIF file (v2_Flash_component_arch.gif) in the
Examples folder.
All components also use the same event model, CSS-based styles, and built-in themes and
skinning mechanisms. For more information on styles and skinning, see Chapter 5, “Customizing
Components,” on page 67. For more information on event handling, see Chapter 3, “Working
with Components,” on page 43.
For a detailed explanation of the version 2 component architecture, see Chapter 7, “Creating
Components,” on page 915.
What’s new in version 2 components
This section outlines the differences between version 1 and version 2 components from the
perspective of a developer using components to build Flash applications. For detailed information
about the differences between the version 1 and version 2 architectures for building components,
see Chapter 7, “Creating Components,” on page 915.
The Component inspector allows you to change component parameters while authoring in
Macromedia Flash and Macromedia Dreamweaver. (See “Setting component parameters”
on page 47.)
The listener event model allows listeners to handle events. (See Chapter 4, “Handling
Component Events,” on page 55.) There isn’t a
clickHandler parameter in the Property
inspector, as there was in Flash MX; you must write ActionScript code to handle events.
Skin properties let you load individual skins (for example, up and down arrows or the check for
a check box) at runtime. (See “About skinning components” on page 80.)
CSS-based styles allow you to create a consistent look and feel across applications. (See “Using
styles to customize component color and text” on page 67.) To set a component style, use the
following syntax:
componentInstance.setStyle("styleName", value).
Themes allow you to drag a new look from the library onto a set of components. (See “About
themes” on page 77.)