Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 248

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

Advertisement

// Define the private variable for the bright setting.
private var _bright:Boolean = true;
// Define the setter to dispatch the events
// corresponding to the effect triggers.
public function set bright(value:Boolean):void {
_bright = value;
if (_bright)
else
}
// Define the getter to return the current bright setting.
public function get bright():Boolean {
return _bright;
}
]]>
</mx:Script>
</mx:Button>
When you declare an event in the form
type="package.eventType")]
[Effect(name="eventnameEffect", event="eventname")]
in the
<mx:Metadata>
and
darken
brighten
the Flex compiler.
For more information on using metadata, see
Components," on page
248
Creating Effects
dispatchEvent(new Event("brighten"));
dispatchEvent(new Event("darken"));
[Event(name="eventName",
, you can also create a corresponding effect, in the form
tag, you insert the metadata statements that define the two new events,
, and the new effect triggers,
45.
. As in the previous example,
darkenEffect
Chapter 5, "Using Metadata Tags in Custom
and
brightenEffect
, to

Advertisement

Table of Contents
loading

Table of Contents