[An Idea] Allow Right Clicks for Flash

I was looking through my archives and I did a little CSS trick before to disable right clicks for Flash. It’s basically putting a layer on top of the Flash so the Flash can’t receive right clicks to make that menu.

But then I thought again, technically it would be possible to let Javascript handle right clicks and pass it onto Flash right? Then both left and right clicks become available for a flash movie. This would be especially useful for games involving the mouse.

you can disble the menu and then there is a keypress number that is undocumented in flash that == right-click, it’s totally explained in ‘Flash Hacks’. BTW theres also a keypress number for scrollup and scrolldown:)

Do you even need that extra layer on top of it? From my understanding, you can eliminate that menu in flash through actionscript. You may also put a right click menu.

I’m certain I’ve seen codes for both of the above while browsing through random actionscript tricks in the past.

You can’t disable the right-click menu with AS but you can use the keyCode 2 along with the static Key.isDown method to detect when the right mouse button is down.

are you sure about that canadian because i thought they got rid of that command :open_mouth:

I suppose you could try it and see:

onEnterFrame = function ():Void {
 if (Key.isDown(2)) {
  trace("right mouse button down");
 }
};

:slight_smile:

ya i think they got rid of that command did you test it?

It’s not possible to get rid of the right click menu in a Flash Movie when it’s played in a browser. It is possible to get rid of it when it is a standalone application.

So basically my idea is to use Javascript to catch all keyboard/mouse clicks and forward it to Flash.

you cant totally get rid of the menu (embedded in html), but u can get close - custom menu code. make a new menu. u still get the settings/about menu items though :frowning:
@bombsledder - ya i think they got rid of that code… mate, did “you” test it? … works bloody nice here.

ya just tested it, forgot where i read that they got rid of it, probably just some noob saying it, works perfect here maybe you could make a javascript class that will stop it would be nice

Err… I’m not sure if you can track right clicks with JS… it’d be cool, though.

It’s basically this:

http://mtsix.com/wp-content/uploads/flash.html

See? No right click, because I’ve layered a DIV tag on top of the flash with CSS.

all you had is <div id=“flash”> or /we

There are 2 divs, one containing the flash, and the other is given the properties 100% height and width, no background.

Doesnt seem to work in IE 7. I still get the menu.

http://s94688749.onlinehome.us/ie.jpg

Ah blah. I’ll check it out.

right-click detection won’t work in firefox 1.5.0.2

Yeah Firefox doesn’t detect it at all. If it did, there wouldn’t be a need for a JS class to pass it onto Flash :stuck_out_tongue:

and opera opens the same menu like pressong on a pages background, doesnt show the “you right clicked!” text

Yeah that means the CSS trick works with Opera, since it shows the page menu.