Do you like my tutorials?

Then consider supporting me on Ko-fi

Talking about Actionscript 2, Flash, Game development and Tutorials.

Today I played the millionth mouse avoider Flash game… Shirk!

I am a real pro at mouse avoider games… look how easily I beat the hard level.

Watch the video!

What a champion…

This happens because you can right click the mouse, showing the menu.

As far as I know, you can’t prevent the menu to show, but you can detect when the player presses the right mouse button.

Just insert into your code, in a place that will be executed every frame, this script:

if (ASnative(800, 2)(2)) {
	// code to execute when the player tries to cheat
}

What is that ASnative function?

It’s an undocumented function used mainly by component developers. You can find some examples at Open Source Flash

Since the documented mouse handlers only detect left mouse button, we need to use this function to do the trick.

But remember this function is undocumented and therefore unsupported.

Moreover, there is no guarantee future versions will support it or work with it

But at the moment it seems to work, and that’s enough.

Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.