When I add event listener to stage in Flash Professional CS6:
stage.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, rightMouseHandler);
or without constant:
stage.addEventListener("rightMouseDown", rightMouseHandler);
right mouse button work ok. I tested this in Flash Player 11.7 (flashplayer_11_sa_debug.exe), Firefox, Chrome, Internet Explorer.
But when I write this in Fash Builder 4.6 - Flex 4.6 application type Web:
stage.addEventListener("rightMouseDown", rightMouseHandler);
right mouse button not working.
.
Remerks
The same Flex project run as AIR application type makes right mouse button work properly.
Any ideas as to why not working in Flash Player?
^^^Edit:^^^ How I adding listener:
Flash Builder 4.6:
<s:Application applicationComplete="completeHandler()" ...>
<fx:Script>
<![CDATA[
private function completeHandler(): void {
stage.addEventListener("rightMouseDown", rightMouseHandler);
}
public function rightMouseHandler(e :MouseEvent) :void {
var col :String = '#' + uint(Math.random()*0xFFFFFF).toString(16);
setStyle('backgroundColor', col);
trace(col);
}
Flash Professional CS6 in 1 frame:
stage.addEventListener("rightMouseDown", rightMouseHandler);
function rightMouseHandler(e :MouseEvent) :void{
var col :uint = uint(Math.random()*0xFFFFFF);
stage.color = col;
trace('#' + col.toString(16));
}