0 Replies Latest reply on Nov 25, 2009 5:17 PM by MBM111

    Can one use the middle & right mouse buttons without the cursor reappearing?

    MBM111

      I want to use all three botton clicks without the cursor reappearing showing. I use Mouse.hide(). All works fine with the Left mouse button. With the middle and right buttons the cursor reappears as soon as they are in the DOWN state (and stays visible until rehidden--see code). Are there Mouse parameters that could be added? (I can't find any such references.) Do I need to create a custom cursor Class that makes the cursor invisible? Here is my simple AS 3 test code. Everything works except that the cursor reappears.

       

      // MyClickListener.fla code

      // Why do the Middle and Right clicks reexpose the mouse cursor as soon as they are in the DOWN state?

       

      import flash.display.DisplayObject;

      import flash.events.*;

      import flash.ui.Mouse;

              

                  Mouse.hide();

                  var leftClick:int = 0;

                  var middleClick:int = 0;

                  var rightClick:int = 0;


      function leftClickHandler(event:MouseEvent):void

      {

                  // Mouse.hide();  I do not need this -- cursor does not reappear at click

                  trace(event.target.name);       

                  trace("You pressed the Left Button.");

                  leftClick ++;

                  trace("Left Clicks = " + leftClick);

      }

      function middleClickHandler(event:MouseEvent):void

      {

                  Mouse.hide(); //I use this to rehide the mouse that reappears after click.

                  trace(event.target.name);

                  trace("You pressed the Middle Button.");

                  middleClick ++;

                  trace("Middle Clicks = " + middleClick);

      }

      function rightClickHandler(event:MouseEvent):void

      {

                  Mouse.hide();  // I use this to rehide the mouse that reappears after click.

                  trace(event.target.name);

                  trace("You pressed the Right Button.");

                  rightClick ++;

                  trace("Right Clicks = " + rightClick);

      }


      stage.addEventListener(MouseEvent.CLICK, leftClickHandler);

      stage.addEventListener(MouseEvent.MIDDLE_CLICK, middleClickHandler);

      stage.addEventListener(MouseEvent.RIGHT_CLICK, rightClickHandler);

       

      Help appreciated.

      Thanks,

      Mike