It's a little hard to be certain, since the error was not 100% reproducible,
but it appears that it occurred if I used "activate" for my pickers, meaning
"focusIn". If I used "focusIn" I ran into a different coercion failure
(perhaps because the pickers derive from Box).

For the moment "focusInPicker" and "change" seem to be doing the trick.

On Tue, Feb 3, 2009 at 4:58 PM, Richard Rodseth <[email protected]> wrote:

> Hi Jeff. Yes, my event classes do descend from Event. I've also run in
> debug mode, but you don't get a
> stack crawl on the 1034. It just says "main thread".
>
> On Tue, Feb 3, 2009 at 4:54 PM, Jeffry Houser <[email protected]> wrote:
>
>>
>>  A single event class being used for multiple events is common within the
>> Flex Framework; why recommend not re-using the same type?
>>
>> Back to the problem:
>>  Are you sure that your event class extends flash.events.Event ?  I might
>> expect odd errors if not.
>>  Have you tried running the code in debug mode to see what is going on;
>> maybe isolate the line which causing the error.
>>
>> Tracy Spratt wrote:
>>
>>  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.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.
>>
>> --
>>  Flexcoders Mailing List
>>
>>
>>
>> --
>> Jeffry Houser, Technical Entrepreneur
>> Adobe Community Expert: 
>> http://tinyurl.com/684b5hhttp://www.twitter.com/reboog711  | Phone: 
>> 203-379-0773
>> --
>> Easy to use Interface Components for Flex 
>> Developershttp://www.flextras.com.com?c=104
>> --http://www.theflexshow.comhttp://www.jeffryhouser.com
>> --
>> Part of the DotComIt Brain Trust
>>
>>  
>>
>
>

Reply via email to