View unanswered posts | View active topics



Reply to topic  [ 1 post ] 
Error #2007 when adding event listener for right click 
Author Message
Member

Joined: Wed Sep 13, 2017 4:10 am
Posts: 1
Hello. I'm trying to strip out the right click menu, and getting an error when adding the event listener.

Full error is:

Code:
C:\...\src\Main.as(41): col: 38 Error: Access of possibly undefined property rightClick through a reference with static type Class.
         stage.addEventListener(MouseEvent.rightClick, game.ignore);


Code is:

Code:
private function init(e:Event = null):void
      {
         removeEventListener(Event.ADDED_TO_STAGE, init);
         // entry point
         
         //Create and run game
         game = new Game(this);
         addEventListener(Event.ENTER_FRAME, runGame);
         
         //Detect key presses and mouse events
         stage.addEventListener(KeyboardEvent.KEY_DOWN, game.keyDown);
         stage.addEventListener(KeyboardEvent.KEY_UP, game.keyUp);
         stage.addEventListener(MouseEvent.MOUSE_MOVE, game.mouseMoved);
         stage.addEventListener(MouseEvent.MOUSE_DOWN, game.mouseDown);
         stage.addEventListener(MouseEvent.MOUSE_UP, game.mouseUp);
         
         stage.addEventListener(MouseEvent.rightClick, game.ignore);
         
      }


Another poster had the same issue several years ago, but he did not get an answer. Thread is here: http://www.flashdevelop.org/community/viewtopic.php?f=13&t=9908

My Flash Player version is 18.0, and my SDK is Flex 4.6.0, AIR 26.0, in response to the questions he received.

Edit: I redownloaded FD after it stopped working, and now right click handling works.

____________________________________________________________________________________________________________________________

Also, the error in the not-a-robot question is still there. I saw another user mention it. There's supposed to be a space before PROBOT. Leaving that here to pay that forward to the next guy who gets confused and googles it.


Wed Sep 13, 2017 4:16 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.