Flash Script - Disable the User's Right Click Menu

This is a dedicated thread for discussing the SitePoint article ‘Flash Script - Disable the User’s Right Click Menu

I did what you said and It doesnt work for some reason, can anyone tell me why

It doesn’t work for me either. I tried it both with and without quotes, but the menu still pops up. I’m viewing it on the latest version of Internet Explorer with the Flash 6 player installed.

Any ideas?

It didn’t work for me. Then I realized they are completely wrong. I inserted this code with all the other parameters and it worked just fine:

<PARAM NAME=menu VALUE=false>

Hi Friends,
I am imran ali from Pakistan(Karachi)please follow the instruction and disable the right click in Flash menu.
Go to flash basic actions>>Fscommand>>commands for standalone player>>Drop Down menu>>select show menu>>Arguments>>False
Export the Swf call in dreamweaver or front page,HTML code<Param name=menu value=false>
Now check it will work.
Everybody happy now!

Hi Friends,
I am imran ali from Pakistan(Karachi)please follow the instruction and disable the right click in Flash menu.
Go to flash basic actions>>Fscommand>>commands for standalone player>>Drop Down menu>>select show menu>>Arguments>>False
Export the Swf call in dreamweaver or front page,HTML code<Param name=menu value=false>
Now check it will work.
Everybody happy now!

Hi Friends,
Go to flash basic actions>>Fscommand>>commands for standalone player>>Drop Down menu>>select show menu>>Arguments>>False
Export the Swf call in dreamweaver or front page,HTML code<Param name=menu value=false>
Now check it will work.
Everybody happy now!

include

<param name=“menu” value=“false”>

this doesnt help protect text from copy and paste

>> this doesnt help protect text from copy and paste

It’s not supposed to.

This works in IE, but not in Mozilla Firefox.

Try using this code

<object classid=‘clsid:D27CDB6E-AE6D-11cf-96B8-444553540000’ codebase=‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0’ width=‘123’ height=‘123’>
<param name=movie value=‘movie.swf’>
<param name=quality value=high>
<param name=‘LOOP’ value=‘false’>
<param name=‘menu’ value=‘false’>
<embed
src=‘movie.swf’
quality=high pluginspage=‘http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash’ type=‘application/x-shockwave-flash’ width=‘123’
height=‘123’
loop=‘false’>
</embed>
</object>

It Do work for Internet explorer, but i need it to be disabled in my .swf file, so that if i give .swf file to any one, it could not zoom in and out from it.

“Posted by: Matt” Code works for me in IE
The first post code was working on Netscape
So, use both codes i guess to hide the menu :slight_smile:

Works in both Mozilla Firebird & IE 6 if, in addition to Matt’s code, you include menu=‘false’ in the embed statement:
<embed …menu=‘false’ loop=‘false’…>

Don’t forget that the <embed> tag is being deprecated in XHTML so you should always specify the <param> alternative in your <object> tag to ensure the Flash code is compliant in the future.

This won’t get rid of the Settings and About menu items. To do this you can use the following JavaScript, which will disable right clicking on the whole page, including over the Flash movie.
<!–
<script language=JavaScript>
var message=“Function disabled.”;

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function(“return false”)

// function to handle right-click anywhere on page including Flash embed.

function handleclick() {
if (event.button==2)
{
// right button (2) was pressed
showAboutBox();
}
}

// function that shows our custom “about” box

function showAboutBox() {

msg = "Right Click Disabled

";

if (event.srcElement.id == “MyFlashMovie”) {

alert = "\


Right Click Disabled";

}

alert(popup_msg);

}

// set handler function for mouse presses

document.onmousedown=handleclick;

</script>

–>
REMEMBER TO INCLUDE id=“MyFlashMovie” in your <object> tag! :slight_smile:

Also, if you need to disable the right-click menu in a Flash .exe file, use ‘Resource Hacker’ (freeware) to open the file. Select ‘Menu’, ‘604’, ‘1036’ and replace the popup “x” function with:
POPUP “x”
{
MENUITEM “&”, 20037
}

This disables the right click menu of a Flash .exe file. I cannot guarantee how legal this is, regarding copyright protection etc, so please do this at your own risk (or don’t do it at all). This merely explains how to, and doesn’t encourage you to do it. :slight_smile:

There is a way to do this in AS but it requires Flash Player 7 so understand not everyone will be able to this. I used this for work because kids kept playing with the computer and messing up the player. I did this along with a mouse hide and it worked great.

//this declares a variable as a menu item.
my_cm = new ContextMenu();

//this says to hide the buttons in the menu. Note: the only thing it doesnt hide is settings.
my_cm.hideBuiltInItems();

//This says to take the variable we created and make it the menu you want to use in the player.
_root.menu = my_cm;

dont function