Is it possible for Flash to ‘notice’ when the Right Mouse Button is clicked?
For instance:
The player press the Right Mouse Button and a message would appear like: “Don’t cheat!” or whatever.
Is it possible? And if so, could someone direct me on how to do it…
you could add a new menu to the context menu that appears when you press the right mouse button.
[AS]myMenu_cm = new ContextMenu();
myMenu_cm.hideBuiltInItems();
myMessage_cmi = new ContextMenuItem(“DONT CHEAT!!!”, cheatFunction);
myMenu_cm.customItems.push(myMessage_cmi);
function cheatFunction() {
trace(" I told you not to cheat!!");
}
_root.menu = myMenu_cm;[/AS]
unfortunately to my knowledge you have to have a function.
so u could try…
[AS]myMenu_cm = new ContextMenu();
myMenu_cm.hideBuiltInItems();
myMenu_cm.onSelect=function(){
// do something like show a hidden movie
trace(“DONT CHEAT!!”)
}
_root.menu = myMenu_cm;[/AS]
I have a question regarding this matter thou…
I was taking a look at this great site ==> LINK
and noticed thar on the right click of the mouse, the menu shows but it has different options, including CONTACT, CREDITS and so on. How can it be done?
Thanks
myMenu_cm = new ContextMenu();
myMenu_cm.hideBuiltInItems();
myMessage_cmi = new ContextMenuItem("DONT CHEAT!!!", cheatFunction);
myMenu_cm.customItems.push(myMessage_cmi);
function cheatFunction() {
// your code goes here for links, email or whatever
// ie: getURL("mailto:youremail@email.com")
}
_root.menu = myMenu_cm;
sorry for bodering you…
but i´m trying to add a link like http://www.kirupa.com but it´s not working.
just the emailto thing… what may i be doing wrong?
Another thing I would love to learn is how to add more than one button on the menu, like H2 website.
thanks a lot for you help!
myMenu_cm = new ContextMenu();
myMenu_cm.hideBuiltInItems();
contactMenu_cmi = new ContextMenuItem(“Contact”, contact);
kirupaMenu_cmi = new ContextMenuItem(“Kirupa.com”, kirupa, true);
myMenu_cm.customItems.push(contactMenu_cmi);
myMenu_cm.customItems.push(kirupaMenu_cmi);
function contact() {
getURL(“mailto:youraddress@yourdomain.com”);
}
function kirupa() {
getURL(“http://www.kirupa.com”, “_blank”);
}
_root.menu = myMenu_cm;
i added a horizontal line, which appears above kirupa.com menu, to seperate the two items. you can change this by
removing to true statement after the constructor function.
…ContextMenuItem(“Kirupa.com”, kirupa*, true*);
I don’t suppose it’s possible to prevent the right-click context menu from coming up at all. I know you can replace items and get rid of most of them, but it’d be nice to use this to create your own custom right-click context menu as opposed to the ugly grey one.