2 Replies Latest reply on May 1, 2007 8:42 AM by MDM_Viper

    Detect Right-Click

      This is a AS3 question (I cant find a specialized forum for AS3). I'm hoping someone from Adobe will be able to answer me on this one.

      With AS2 you could tell if the right mouse button was being pressed by checking if Key.isDown(2) was equal to true.

      But with AS3 and the new Keyboard class this won't work anymore. Is there any way to check if the right mouse button is being pressed (yes I know this is useless in a normal flash movie but I need it)?

      Has this functionality actually been removed?
        • 1. Re: Detect Right-Click
          Rothrock Level 5
          Really, Key.isDown(2)? I remember there was an undocumented feature that would do this, but I've never heard of the mouse button being tied into the key class.

          But that is the risk of undocumented features.

          There is a context menu class, but I'm guessing that isn't what you are looking for.
          • 2. Re: Detect Right-Click
            MDM_Viper Level 1
            Yes with the new API the way to get mouse down is to use the events like so :

            stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
            function mouseDownHandler(event:MouseEvent) {
            trace("left mouse button has been pressed")

            but this only catches the primary mouse button.

            Please Adobe, tell me we can still catch the alternative mouse button press!