91
8
CHAPTER 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.
Содержание FLEX 2 - CREATING AND EXTENDING COMPONENTS
Страница 1: ...Creating and Extending Flex 2 Components Adobe Flex 2...
Страница 6: ...6 Contents...
Страница 10: ...10 About Flex Documentation...
Страница 12: ......
Страница 24: ...24 Creating Flex Components...
Страница 74: ...74 Compiling Components...
Страница 76: ......
Страница 118: ...118 Creating Advanced MXML Components...
Страница 120: ......
Страница 182: ...182 Creating Advanced Visual Components in ActionScript...
Страница 194: ...194 Creating Custom Style Properties...
Страница 204: ...204 Creating Template Components...
Страница 206: ......
Страница 216: ...216 Creating Custom Formatters...
Страница 254: ...254 Index...