Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 122

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

Flex components are implemented as a class hierarchy in ActionScript. Each component in
your application is an instance of an ActionScript class. The following example shows just a
portion of this hierarchy:
Container
Box
Form
VBox
This example shows a portion of the class hierarchy. For a complete description of the
class hierarchy, see the Adobe Flex 2 Language Reference.
All Flex visual components are derived from the ActionScript
your own components, you can create a subclass from the UIComponent class, or from any of
its subclasses.
The class you choose to use as the superclass of your custom component depends on what you
are trying to accomplish. For example, you might require a custom button control. You could
create a subclass of the UIComponent class, then recreate all of the functionality built into the
Flex Button class. A better and faster way to create your custom button component is to create
a subclass of the Flex Button class, and then modify it in your custom class.
This topic describes how to create simple ActionScript components. Simple components are
subclasses of existing Flex components that modify the behavior of the component, or add
new functionality to it. For example, you might add a new event type to a
modify the default styles or skins of a
You can also create advanced ActionScript components. Advanced ActionScript components
might have one of the following requirements:
Modify the appearance of a control or the layout functionality of a container
Encapsulate one or more components into a composite component
Subclass UIComponent to create components
For information on creating advanced ActionScript components, see
Advanced Visual Components in ActionScript," on page
122
Creating Simple Visual Components in ActionScript
UIComponent
Button
NumericStepper
DataGrid
ComboBase
ComboBox
UIComponent
control.
147.
class. To create
Button
control, or
Chapter 10, "Creating

Advertisement

Table of Contents
loading

Table of Contents