Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 112

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

Advertisement

Handling events from composite components
Composite components are components that use a container for the root tag, and define child
components in that container. You handle events generated by the root container in the same
way as you handle events generated by simple MXML components. That is, you can handle
the event within the MXML component, within the referencing file, or both. For more
information, see
"Handling events from simple MXML components" on page
107.
To handle an event that a child of the root container dispatches, you can handle it in the
MXML component in the same way as you handle an event from the root container.
However, if a child component of the root container dispatches an event, and you want that
event to be dispatched to the referencing file, you must add logic to your custom component
to propagate the event.
For example, you can define a component that uses an
tag as the root tag, and
<mx:Form>
include within it a
ComboBox
control. Any event that the
Form
container dispatches, such a
event, is dispatched to the referencing file of the custom component. However, the
scroll
event of the ComboBox control is dispatched only within the custom MXML
close
component.
112
Creating Advanced MXML Components

Advertisement

Table of Contents
loading

Table of Contents