I am trying to create a boolean where it checks if the right-mouse button is pressed or not. With the left mouse button this method works, but with the right mouse button the boolean stays true, how do I fix this?
public var mDown:Boolean = false;
public var rmDown:Boolean = false;
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseHandler);
stage.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, mouseHandler);
stage.addEventListener(MouseEvent.RIGHT_MOUSE_UP, mouseHandler);
private function mouseHandler(e:MouseEvent){
switch(e.type){
case MouseEvent.MOUSE_DOWN: mDown = true;
break;
case MouseEvent.MOUSE_UP: mDown = false;
break;
case MouseEvent.RIGHT_MOUSE_DOWN: rmDown = true;
break;
case MouseEvent.RIGHT_MOUSE_UP: rmDown = false;
}
}
My Flash exports to Flash Player 11.2! Maybe I can try something with RIGHT_CLICK?