To propagate the
close
for it in the MXML component that redispatches it, as the following example shows:
<?xml version="1.0"?>
<!-- mxmlAdvanced/myComponents/AddressForm.mxml -->
<mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*">
<mx:Metadata>
[Event(name="close", type="flash.events.Event")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import flash.events.Event;
// Redispatch event.
private function handleCloseEventInternal(eventObj:Event):void {
dispatchEvent(eventObj);
}
]]>
</mx:Script>
<mx:FormItem label="Name">
<mx:TextInput id="name1" />
</mx:FormItem>
<mx:FormItem label="Street">
<mx:TextInput id="street" />
</mx:FormItem>
<mx:FormItem label="City" >
<mx:TextInput id="city" />
</mx:FormItem>
<mx:FormItem label="State" >
<mx:ComboBox close="handleCloseEventInternal(event);">
<mx:dataProvider>
<mx:Array>
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:FormItem>
</mx:Form>
event outside of the custom component, you define an event listener
<mx:String>AK</mx:String>
<mx:String>AL</mx:String>
Working with events
113
Need help?
Do you have a question about the FLEX 2 - CREATING AND EXTENDING COMPONENTS and is the answer not in the manual?
Questions and answers