Quantcast
Channel: Adobe Community : Popular Discussions - Archived Discussions
Viewing all articles
Browse latest Browse all 21156

How do I keep the Middle and Right mouse cursor from reappearing during and after a click?

$
0
0

All I want to do is use all three botton clicks without the cursor showing (assistive technology situation). So I use Mouse.hide(). All works fine with the Left mouse button. With the middle and right buttons the cursor reappears as soon as the middle and right mouse is 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.

 

// MyClickListener.fla code

// Using the Stage to listen for button events

// 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,

Michael


Viewing all articles
Browse latest Browse all 21156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>