Configuration for Flash's MouseEvent.RIGHT_CLICK

What configuration settings do I need to use to enable the right click (disable context menu) when targeting flash with FlashDevelop and/or HaxeDevelop?
It works fine when I compile an as3proj but doesn’t work when I’m using HaXe/OpenFL, any help on this is greatly appreciated.

Or how do I target later versions of the swf player when using HaXe since the project properties is all different when using HaXe?

I’ve already tried setting Tools > Program Settings > HaXeContext > Default Flash Version to 12.
And I added app swf-version=“17” to project.xml.
But still getting null when I trace MouseEvent.RIGHT_CLICK

Some sources say HaXe doesn’t recognize any swf version later than 12 and others say you need to use the git version of HaXe. Anyone else having this problem?

It was definitely possible in an old version of OpenFL. In fact, OpenFL automatically disabled the right-click menu with no option to re-enable it.

Adobe’s documentation states that RIGHT_CLICK was introduced in Flash Player 11.2, and Haxe agrees. And on top of that, 11.2 is the default.

Try setting it back to the default, and see if you still get null.

Ok I removed that line in project.xml now I’m getting the problem when I test it but it works correctly when I open the swf straight from the folder.
How can I set it to open the correct flash player when testing?
I wanna get this sorted out properly so I know better next time.

Does it give the same error if you run lime run flash? That’s (approximately) how HaxeDevelop runs it.

You could also try setting Tools -> Program settings -> Flash Viewer -> External Player Path, but I highly doubt that’s what it uses.

External player path is set to flashplayer_22_sa_debug.exe
And there’s no change when running from the command line.

What do you mean by this? Do you mean there’s no change from the result you get in HaxeDevelop, or no change from the result you get when opening it manually?

There’s no change from when I hit the test button.
The test button and ‘lime run flash’ both produce a .swf running in flashplayer 11.
Opening the .swf from the folder produces a .swf running in flashplayer 22.

I’d like to be able to test and debug from at least 11.2 which I’m not sure what swf-version that is, 15 I think.

Could you check what the default SWF player is on your system?

Right-click on a SWF, and select properties. See what version is used for the “Open with” option there

Adobe Flash Player 11.1r102

Good to know - this means the issue is somewhere in Lime. My first guess is that it’s this line:

player = Sys.getEnv ("FLASH_PLAYER_EXE");

If your system has a FLASH_PLAYER_EXE environment variable, Lime will use that instead of the program you chose to open Flash files. To see if this is the case:


To set a new value:

> setx FLASH_PLAYER_EXE "C:\Path\To\Flash_Player_22.exe"

That did the trick.
Had to reboot but everything’s working fine now.

Or change your Windows default Flash Player to version 22. Lime uses your OS default

As far as I can tell, the default already was 22.

When you look at the “open with” menu, you get a list of alternatives, often not including the default program.

I didn’t get any alternatives, just 11.1.
I think I have 2 or 3 copies of flex on this comp.
It was quite a challenge getting everything set up properly, didn’t rly know what I was doing lol.


  1. Right-click on a SWF
  2. Select “Properties”
  3. In the “Opens with” line, click “Change…”
  4. Choose “More apps” when it prompts for a choice
  5. Scroll to the bottom and choose “Look for another app on this PC” (or something like that)
  6. Browse and select the standalone Flash Player Content Debugger standalone projector
  7. Hit “Apply” when you’re done

It’s a list of length 1. :stuck_out_tongue:

My point is that when you double-click, you get player version 22, right? So 22 is the system default, and 11.1 is an alternative. If not, follow Joshua’s steps.

Oh yeah, it’s testing with version 22 after setting the FLASH_PLAYER_EXE path.
Just wondering what all the tricks are so I don’t come across this problem again.
Are there any plans to have a drop down selector like there is in FlashDevelop as3proj or is that kind of thing just handled by the project.xml

Opening up the bin folder and double-clicking on the SWF is unaffected by FLASH_PLAYER_EXE. Which is why I’m pretty sure your system default is version 22.

Feel free to double-check, though (right click -> properties and look at the “opens with” program).

Now that you’ve set FLASH_PLAYER_EXE, you won’t have to worry about it on this computer again.

The alternative is to delete FLASH_PLAYER_EXE, which should make Lime use the system default.