Skip to main content
Participant
September 21, 2013
Answered

Right Click?

  • September 21, 2013
  • 3 replies
  • 844 views

So I want to dissapear or reappear a object by right click (the objeck has been given name as:wow)

Can anybody help me with the syntax. If it's left click, I can figure it out. But since this is right click, I can.

This topic has been closed for replies.
Correct answer Aaron Beall

Right click is supported in AIR and Flash Player 11.2 and above. Example:

mySprite.addEventListener(MouseEvent.RIGHT_CLICK, onRightClick);

function onRightClick(e:MouseEvent):void {

          mySprite.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 255); // make it red!

}

I've found that it doesn't work in the Flash IDE (test movie), strangely.

-Aaron

3 replies

kglad
Community Expert
Community Expert
September 22, 2013

use something else.  the right click is used by flash player for the context menu.

Aaron BeallCorrect answer
Inspiring
September 28, 2013

Right click is supported in AIR and Flash Player 11.2 and above. Example:

mySprite.addEventListener(MouseEvent.RIGHT_CLICK, onRightClick);

function onRightClick(e:MouseEvent):void {

          mySprite.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 255); // make it red!

}

I've found that it doesn't work in the Flash IDE (test movie), strangely.

-Aaron

kglad
Community Expert
Community Expert
September 28, 2013

good info!  thank you.