Welcome to Virtual Tutorial World Guest!



Disable Right Click Menu

 
Post new topic   Reply to topic    VTW Forum Index -> Actionscript
View previous topic :: View next topic  
Author Message
Please Register and Login to this forum to stop seeing this advertsing.





Tokens:


Posted:     Post subject:

Back to top
computergeek67
Administrator
Administrator


Joined: 31 Jul 2007
Posts: 144


Tokens: 147
Location: US

PostPosted: Mon Mar 31, 2008 3:35 pm    Post subject: Disable Right Click Menu Reply with quote

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.





_________________



Come to me if you have any questions
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    VTW Forum Index -> Actionscript All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Virtual Tutorial World ©2007-2008 computergeek67

Affiliates