A common Event interface makes sense.  I don't think it will fully solve
the problem.  Folks will still expect a common base class and make
mistakes.  It is a rough point in FlexJS right now, but I think there are
bigger fish to fry.  Folks writing handlers in MXML will not have this
problem as often since the compilers will put the right event class on the
handler.

Regarding keyboard events, IMO, our components like Alert should not be
forwarding MouseEvents to the API surface.  The MouseEvents on the OK
button should issue a regular Event or Event subclass with a property
containing which button was clicked, so a keyboard event could also be
handled by a separate controller and issue the same non-MouseEvent.

Thanks,
-Alex

On 7/15/16, 6:59 AM, "Peter Ent" <p...@adobe.com> wrote:

>I looked back through the commit log because I knew there were reasons for
>having org.apache.flex.events.MouseEvent extend
>org.apache.flex.Events.Event rather than flash.mouseEvent. There were
>cases where was code that was expecting a generic
>org.apache.flex.events.Event and having org.apache.flex.events.MouseEvent
>inherit from flash.events.Event was causing problems. I would be careful
>about changing this wholesale.
>
>Peter Ent
>Adobe Systems/Apache Flex Project
>
>On 7/15/16, 9:10 AM, "Christofer Dutz" <christofer.d...@c-ware.de> wrote:
>
>>But if flex.MouseEvent extended flash.MouseEvent and implemented the
>>flex.Event interface, it would be both flash.MouseEvent as well as
>>flex.Event ...
>>
>>
>>Chris
>>
>>________________________________
>>Von: Harbs <harbs.li...@gmail.com>
>>Gesendet: Freitag, 15. Juli 2016 13:58:03
>>An: dev@flex.apache.org
>>Betreff: Re: [FlexJS] MouseEvent extends flash event
>>
>>The problem is related to inheriting Flash MouseEvents.
>>
>>On Jul 15, 2016, at 2:46 PM, Christofer Dutz <christofer.d...@c-ware.de>
>>wrote:
>>
>>> Well how about having an Interface "Event" and every form of event
>>>implementing that? I think a MouseEvent should be an Event.
>>>
>>>
>>> Chris
>>>
>>> ________________________________
>>> Von: yishayw <yishayj...@hotmail.com>
>>> Gesendet: Freitag, 15. Juli 2016 11:52:17
>>> An: dev@flex.apache.org
>>> Betreff: Re: [FlexJS] MouseEvent extends flash event
>>>
>>> It turned out handleOK on SimpleAlertView was expecting an Event and
>>> complained about receiving a MouseEvent. I changed it (pull request
>>>pending)
>>> so it expects MouseEvent instead and that seems to have fixed it.
>>>
>>> I'm not sure however that the bigger issue isn't that MouseEvent does
>>>not
>>> extend Event. It seems intuitive to me that it would. It's also a
>>>difficult
>>> error to track down. It only appears in runtime, and the stack trace
>>>does
>>> not point you to the event handler that has the wrong signature.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MouseEvent-e
>>>x
>>>tends-flash-event-tp53730p53923.html
>>> Sent from the Apache Flex Development mailing list archive at
>>>Nabble.com.
>>
>

Reply via email to