On 10/18/14, 1:05 AM, "OmPrakash Muppirala" <bigosma...@gmail.com> wrote:

>On Oct 17, 2014 10:42 PM, "Alex Harui" <aha...@adobe.com> wrote:
>>
>> Why did we need our own MouseEvent?  I was expecting to use
>> flash.events.MouseEvent and whatever the native MouseEvent is in
>> HTML/JS/CSS?
>
>
>This MouseEvent is just a wrapper around the respective native
>MouseEvents.
>
>I am following the pattern of the FlexJS DragEvent.
>
>Is there another/better way to do this?
Don’t know.  I know we currently kill “click” and dispatch another “click”
of our own Event type.  The goal there was to remove the mouse event
properties so that click was more of a “semantic” event than an “input”
event.  I considered using a different name like “command” but I think
folks are used to “click”.  But that might need to be revisited if folks
use the MouseEvent properties when processing “click”.

I haven’t tried using other mouse events like “rollOver” in MXML.  Is that
the scenario that prompted the wrapping of MouseEvent?  Because JS isn’t
strongly-typed, I was wondering if we could just create a
flash.events.MouseEvent to make the compiler happy but let the browser
dispatch its native MouseEvent.

The thing that really caught my eye was the changing of the event type
names from “rollOver” to “rollOver_”.  Won’t that result in folks having
to use the underscore in their MXML event handlers?  Also, won’t that
require folks to use the constants like MouseEvent.ROLL_OVER in other
code?  Lots of people don’t use the constants so I’m wondering if we’ll
get complaints about that.

Maybe it is better if we do wrap MouseEvent, but I think we should retain
the event type names if possible.

-Alex

Reply via email to