Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 18

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

Advertisement

Some basic guidelines include the following:
MXML components and ActionScript components both define new ActionScript classes.
Almost anything that you can do in a custom ActionScript custom component, you can
also do in a custom MXML component. However, for simple components, such as
components that modify the behavior of an existing component or add a basic feature to
an existing component, it is simpler and faster to create them in MXML.
When your new component is a composite component that contains other components,
and you can express the positions and sizes of those other components using one of the
Flex layout containers, you should use MXML to define your component.
To modify the behavior of the component, such as the way a container lays out its
children, use ActionScript.
To create a visual component by creating a subclass from UIComponent, use
ActionScript.
To create a nonvisual component, such as a formatter, validator, or effect, use
ActionScript.
To add logging support to your control, use ActionScript. For more information, see
Chapter 11, "Logging," in Building and Deploying Flex 2 Applications.
The Flash Professional 8 authoring environment does not support ActionScript 3.0.
Therefore, you should not use it to create ActionScript components for Flex 2. Instead,
you should use the Flex Builder IDE.
For more information on custom MXML components, see
MXML Components," on page
Chapter 9, "Creating Simple Visual Components in ActionScript," on page
Creating new components
Your application might require you to create components, rather than modifying existing
ones. To create components, you typically create them in ActionScript by creating a subclass
from the
UIComponent
components. You then add the required functionality to your new component to meet your
application requirements.
For more information, see
ActionScript," on page
18
Creating Flex Components
77. For more information on ActionScript components, see
class. This class contains the generic functionality of all Flex
Chapter 10, "Creating Advanced Visual Components in
147.
Chapter 7, "Creating Simple
121.

Advertisement

Table of Contents
loading

Table of Contents