# \[An Idea\] Allow Right Clicks for Flash

**URL:** https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373
**Category:** open source
**Created:** [April 12, 2006, 9:02pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373 "2006-04-12T21:02:50Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 12, 2006, 9:02pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/1 "2006-04-12T21:02:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)
#### Post date: [April 12, 2006, 9:05pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/2 "2006-04-12T21:05:27Z")

</div>

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:)

---

<div class="post-metadata">

### Author: ![hl1](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hl1/32/849_2.png) [@hl1](https://forum.kirupa.com/u/hl1)
#### Post date: [April 12, 2006, 9:05pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/3 "2006-04-12T21:05:40Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [April 12, 2006, 10:15pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/4 "2006-04-12T22:15:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)
#### Post date: [April 12, 2006, 10:44pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/5 "2006-04-12T22:44:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [April 12, 2006, 10:50pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/6 "2006-04-12T22:50:16Z")

</div>

> [@bombsledder](#):
>
> are you sure about that canadian because i thought they got rid of that command 😮

I suppose you could try it and see:

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

```

🙂

---

<div class="post-metadata">

### Author: ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)
#### Post date: [April 12, 2006, 11:04pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/7 "2006-04-12T23:04:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 12, 2006, 11:20pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/8 "2006-04-12T23:20:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codemonkeypete](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@codemonkeypete](https://forum.kirupa.com/u/codemonkeypete)
#### Post date: [April 12, 2006, 11:57pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/9 "2006-04-12T23:57:27Z")

</div>

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 ☹  
@bombsledder - ya i think they got rid of that code… mate, did “you” test it? … works bloody nice here.

---

<div class="post-metadata">

### Author: ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)
#### Post date: [April 13, 2006, 12:18am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/10 "2006-04-13T00:18:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)
#### Post date: [April 13, 2006, 12:41am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/11 "2006-04-13T00:41:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 13, 2006, 12:44am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/12 "2006-04-13T00:44:43Z")

</div>

It’s basically this:

[http://mtsix.com/wp-content/uploads/flash.html](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.

---

<div class="post-metadata">

### Author: ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)
#### Post date: [April 13, 2006, 1:00am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/13 "2006-04-13T01:00:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 13, 2006, 1:06am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/14 "2006-04-13T01:06:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![999](https://avatars.discourse-cdn.com/v4/letter/9/c5a1d2/32.png) [@999](https://forum.kirupa.com/u/999)
#### Post date: [April 13, 2006, 4:37am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/15 "2006-04-13T04:37:26Z")

</div>

> [@MTsoul](#):
>
> See? No right click, because I’ve layered a DIV tag on top of the flash with CSS.

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

[http://s94688749.onlinehome.us/ie.jpg](http://s94688749.onlinehome.us/ie.jpg)

---

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 13, 2006, 5:10am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/16 "2006-04-13T05:10:11Z")

</div>

Ah blah. I’ll check it out.

---

<div class="post-metadata">

### Author: ![fluid\_tw0](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fluid\_tw0](https://forum.kirupa.com/u/fluid_tw0)
#### Post date: [April 14, 2006, 8:51pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/17 "2006-04-14T20:51:08Z")

</div>

right-click detection won’t work in firefox 1.5.0.2

---

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 15, 2006, 1:11am UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/18 "2006-04-15T01:11:48Z")

</div>

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 😛

---

<div class="post-metadata">

### Author: ![Bash321](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Bash321](https://forum.kirupa.com/u/Bash321)
#### Post date: [April 21, 2006, 8:11pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/19 "2006-04-21T20:11:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)
#### Post date: [April 21, 2006, 8:18pm UTC](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373/20 "2006-04-21T20:18:43Z")

</div>

> [@Bash321](#):
>
> 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.

[Next page](https://forum.kirupa.com/t/an-idea-allow-right-clicks-for-flash/185373.md?page=2)
