In trying to figure out why something was not working in my app, I discovered 
that I believe the code in MouseEvent.buttonDown is wrong.

MouseEvent has the following code:

public function get buttonDown():Boolean
{
    return button > -1 && button < 3;
}

While BrowserEvent has the following more complex code:
public function get buttonDown():Boolean
{
    if(_buttons > -1)
        return _buttons == 1;
    var ev:* = wrappedEvent.getBrowserEvent();
    //Safari does not yet support buttons
    if ('buttons' in ev)
        return ev["buttons"] == 1;
    return ev["which"] == 1;
}

AIUI, button while never be -1. Both the left button and no button will be 0.

There’s also a difference in proposed behavior. In MouseEvent, any button would 
theoretically return true, while BrowserEvent will only return true if the left 
button is pressed.

Any objections to changing MouseEvent to match BrowserEvent?

Thanks,
Harbs

Reply via email to