MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 48

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

Implement the
7.
Implement the
8.
Implement the
9.
Implement the
10.
Add properties, methods, and metadata.
11.
The ordering of methods that you implement in this process mirrors that in the component
instantiation life cycle. By understanding which methods are called and in what order, you can
better understand how you write a component's class file. For more information, see
component instantiation life cycle" on page
Each of the steps in this process is covered in more detail in the remainder of this chapter.
Selecting a parent class
Most components share some common behavior and functionality. Flash includes two base classes
to supply this commonality: UIObject and UIComponent. By extending these classes, your
components have a basic set of methods, properties, and events.
Note: Macromedia recommends that you base your components on the UIComponent class rather
than the UIObject class. The UIComponent class provides more built-in functionality, but maintains
the flexibility of extending the UIObject class.
UIObject and UIComponent are the base classes of the component architecture. Understanding
the principles at work in these two classes is important for building components.
The following table briefly describes the two base classes:
Class
mx.core.UIComponent UIObject
mx.core.UIObject
48
Chapter 3: Creating Advanced Components in Flash MX 2004
method.
createChildren()
method.
measure()
method.
layoutChildren()
method.
draw()
Extends
Description
UIComponent is the base class for all Flex components. It can
participate in tabbing, accept low-level events such as keyboard
and mouse input, and be disabled so it does not receive mouse
and keyboard input.
The UIComponent class lets you perform the following tasks:
• Create focus navigation
• Enable and disable components
• Resize components
Macromedia recommends using the UIComponent class rather
than the UIObject class as the base class for your custom
components.
MovieClip UIObject is the base class for all graphical objects. It can have
shape, draw itself, and be invisible.
The UIObject class lets you perform the following tasks:
• Edit styles
• Handle events
• Resize by scaling
Macromedia does not recommend using the UIObject class
rather than the UIComponent class as the base class for your
custom components.
51.
"About the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents