I have a few MXML components that provide reusable pickers for things like
date ranges. I also nest these components.
Is it OK to reuse event types like "change" and "activate", but associated
with different event classes?
For that matter must an event type always be associated with one class?
I dispatching non-bubbling events from these components, and set up the
meta-info as expected:
<mx:Metadata>
[Event(name="activate",type="com.companyname.appname.event.picker.DateRangePickerEvent")]
</mx:Metadata>
and use them like this:
<picker:DateRangePicker
activate="onActivateDateRangePicker(event)"
/>
I'm occasionally getting an error like this:
TypeError: Error #1034: Type Coercion failed: cannot convert
flash.events::ev...@f4130d1 to
com.companyname.appname.event.picker.DateRangePickerEvent.
Who would be trying to cast an event to my type? Changing the event type to
"activatePicker" seems to be helping, but I'd rather not have a
proliferation.