Actually, never mind.  I think I figured it out.  An event named "move" was already declared previously by the framework.  I guess I should just call it something else.  An interesting scenario, anyway...

On 3/10/06, Jason Y. Kwong <[EMAIL PROTECTED]> wrote:
My custom component broadcasts an event called "move".  So I declare it in the MXML:

   <mx:Metadata>
      [Event(name="move", type="flash.events.Event ")]
   </mx:Metadata>

And then later dispatch it:

   dispatchEvent(new Event("move"));

But I get a runtime error when dispatching:

   Type Coercion failed: cannot convert flash.events::[EMAIL PROTECTED] to mx.events.MoveEvent

If I change my dispatch to this:

   dispatchEvent(new MoveEvent("move"));

It works fine.  It also works fine if I rename the event to something else.  It looks like Flex expects any event named "move" to be of type mx.Events.MoveEvent, no matter what you put in the Metadata tag.  Surely it wasn't meant to be this way?



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to