Archive for VTW 
 


       VTW Forum Index -> Actionscript
computergeek67

Disable Right Click Menu

In this tutorial I will teach you how to disable the right click menu, and add you own menu tools.

Let's start with disabling the menu. In the first frame of your game or movie, add this line of code:
Code:
Stage.showMenu = false;
Your menu should now look like this:


To customize the menu and add you own items, use this code:
Code:
var myMenu=new ContextMenu();
myMenu.hideBuiltInItems();
myMenu.customItems.push(new ContextMenuItem("Virtual Tutorial World", itemHandler0));
myMenu.customItems.push(new ContextMenuItem("Hpup", itemHandler1));
myMenu.customItems[1].separatorBefore = true; //this will add a separator between the two items
function itemHandler0(obj, item){
getURL("http://vtw.myfreeforum.org")
myMenu.customItems[0].enabled=false;
myMenu.customItems[1].enabled=true;
}
function itemHandler1(obj, item){
getURL("http://hpup.quotaless.com")
myMenu.customItems[0].enabled=true;
myMenu.customItems[1].enabled=false;
}
_root.menu=myMenu;
The new menu should look like this:

Of course you can customize it to your needs.


       VTW Forum Index -> Actionscript
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum