User Guide
916 Chapter 7: Creating Components
What’s new in version 2 components
The current version (version 2) of the Macromedia Component Architecture is very different
from the Macromedia Flash MX version (version 1). The following list provides an overview of
some of the changes that affect component developers:
New base classes provide a new component hierarchy. In version 1 components, the base class
was FUIComponent. In version 2, the base classes are the UIObject class and UIComponent
class. See “Selecting a parent class” on page 924.
Manager classes are system-level static classes that provide common, reusable pieces of
functionality. The version 2 architecture includes a Focus Manager
(mx.managers.FocusManager), Popup Manager (mx.managers.PopUpManager), Style Manager
(mx.styles.StyleManager), and a Depth Manager (mx.managers.DepthManager).
The built-in live preview allows users to see changes to a component while authoring. In Flash
MX, you had to create a live-preview SWF file for each component. In Flash MX 2004,
Macromedia has made this much easier by allowing you to compile your component into an
SWC file or compiled clip that automatically contains a live-preview file. See “Exporting and
distributing a component” on page 953.
Metadata tag attributes allow you to inform the Flash Integrated Development Environment
(IDE) and compiler about the parameters and attributes of your component. For example, you
can specify component parameters in the component's class file rather than in the Component
Definition dialog box. See “Adding component metadata” on page 935.
The broadcaster/listener event model allows components to send events to more than one
listener. See “Dispatching events” on page 948.
CSS-based styles provide a powerful, standards-based method for configuring the look and feel
of components. See “About styles” on page 950.
ActionScript 2.0 class files contain all the component code. In Flash MX, you had to have all
your code inside the FLA file in an
#initclip #endinitclip block. When creating version 2
components, you write your code in ActionScript 2.0 in an external class file and specify the
component’s class in the Linkage Properties and Component Definition dialog boxes. See
“Creating the ActionScript class file” on page 930.
The SWC file format allows you to export your component in a package and prevents you from
needing to recompile code within those packages. See “Exporting and distributing a component”
on page 953.