Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 110

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

Advertisement

You dispatch new event types by using the
example shows:
<?xml version="1.0"?>
<!-- mxmlAdvanced/myComponents/TextAreaEnabled.mxml -->
<mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Metadata>
[Event(name="enableChanged", type="flash.events.Event")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import flash.events.Event;
// Define private variable to hold the enabled state.
private var __enableTA:Boolean;
// Define a setter method for the private variable.
public function set enableTA(val:Boolean):void {
__enableTA = val;
enabled = val;
// Define event object, initialize it, then dispatch it.
dispatchEvent(new Event("enableChanged"));
}
// Define a getter method for the private variable.
public function get enableTA():Boolean {
return __enableTA;
}
]]>
</mx:Script>
</mx:TextArea>
110
Creating Advanced MXML Components
method, as the following
dispatchEvent()

Advertisement

Table of Contents
loading

Table of Contents