Chapter 8: Creating Advanced Mxml Components; About Reusable Mxml Components - Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual

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

Advertisement

CHAPTER 8
8
Creating Advanced MXML
Components
One of the common goals when you create MXML components is to create configurable and
reusable components. For example, you might want to create MXML components that take
properties, dispatch events, define new style properties, have custom skins, or use other
customizations.
This topic describes advanced techniques for creating advanced MXML components. For
information about how to create and deploy simple MXML components, including how to
apply styles and skins to your MXML components, see the topic
Chapter 7, "Creating Simple
MXML Components," on page
77.
Contents

About reusable MXML components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

Adding custom properties and methods to a component . . . . . . . . . . . . . . . . . . . . . . 92
Working with events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
About interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
About reusable MXML components
One design consideration when you create custom MXML components is reusability. That is,
do you want to create a component that is tightly coupled to your application, or create one
that is reusable in multiple applications?
A tightly coupled component is written for a specific application, often by making it
dependent on the application's structure, variable names, or other details. If you change the
application, you might have to modify a tightly coupled component to reflect that change. A
tightly coupled component is often difficult to use in another application without rewriting it.
You design a loosely coupled component for reuse. A loosely coupled component has a well-
defined interface that specifies how to pass information to the component, and how the
component passes back results to the application.
91

Advertisement

Table of Contents
loading

Table of Contents