User Guide
147
10
CHAPTER 10
Creating Advanced Visual
Components in ActionScript
This topic describes the details of creating advanced visual components for use in Adobe Flex
applications. This topic assumes that you are familiar with creating simple ActionScript
components as described in Chapter 9, “Creating Simple Visual Components in
ActionScript,” on page 121.
Contents
About creating advanced components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Implementing the component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Making components accessible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Adding version numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Best practices when designing a component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Example: Creating a composite component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
About creating advanced components
Simple visual components are subclasses of existing Flex components that modify the
appearance of the component by using skins or styles, or add new functionality to the
component. For example, you add a new event type to a Button control, or modify the default
styles or skins of a DataGrid control. For more information, see Chapter 9, “Creating Simple
Visual Components in ActionScript,” on page 121.
This topic describes how to create advanced visual components in ActionScript. In advanced
components, you typically perform the following actions:
■ Modify the visual appearance or visual characteristics of an existing component.
■ Create a composite component that encapsulates two or more components within it.
■ Create a component by creating a subclass of the UIComponent class.