Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 101

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

Advertisement

If you omit the event name specification from the
automatically generates and dispatches an event named
value remains the same on a write, Flex does not dispatch the event or update the
property.
Alternatively, you can place the
This makes all public properties that you defined as variables, and all public properties
that you defined by using both a setter and a getter method, usable as the source of a
binding expression.
When you use the
applies to public properties; it does not apply to private or protected properties, or to
properties defined in any other namespace. You must insert the
tag before a nonpublic property to make it usable as the source for a data binding
expression.
Add a call to the
3.
event name in the
For more information on using the
Passing references to properties of MXML
components
One of the ways that you can make a component reusable is to design it so that users can pass
values to the component by using public properties of the component.
binding in custom properties" on page 99
components by using MXML and ActionScript, and shows how to pass values to those
properties.
Rather than passing a value to a component, you can pass a reference to it. The reference
could be to the calling component, to another component, or to a property of a component.
This section describes several different ways of passing references to your components.
Accessing the Application object
The
Application
object is the top-level object in a Flex application. Often, you must reference
properties or objects of the Application object from your custom component. Use the
mx.core.Application.application
[Bindable]
metadata tag before a public class definition, it only
[Bindable]
method to dispatch the event when you define the
dispatchEvent()
metadata tag.
[Bindable]
[Bindable]
static property to reference the application object.
Adding custom properties and methods to a component
[Bindable]
propertyChange
metadata before a public class definition.
tag, see
"Bindable metadata tag" on page
describes how to define properties for MXML
metadata tag, Flex
. If the property
metadata
[Bindable]
"Supporting data
51.
101

Advertisement

Table of Contents
loading

Table of Contents