I would not use the same type name.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Richard Rodseth
Sent: Tuesday, February 03, 2009 6:11 PM
To: [email protected]
Subject: [flexcoders] Another 1034 - events and event types

 

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.DateRa
ngePickerEvent")]
    </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.





 

Reply via email to