View Full Version : detect right click
orange gold
06-03-2007, 12:41 AM
no im not talking about the code were you right click and it says play zoom in zoom out and everything i know how to alter those with actionscript im talking about detecting so if you right click on an object a menu appears saying attack this play
maybe if i use on leftclick(2) ?
and make a var command for it
orange gold
06-03-2007, 12:43 AM
i dont know why this doesnt work but im trying to figure an alternate way to detect
_root.onEnterFrame = function() {
if (Key.isDown(2)) {
rightClick();
}
rightClickDown();
} else if (this.rightClickDown) false {
this.wasDown = false;
rightClickUp();
}
};
function rightClickDown() {
trace("you right clicked!")
}
orange gold
06-03-2007, 12:47 AM
ive got it
...
// full right click menu alter
function deadClick () {
}
function gotoMySite () {
getURL("http://albert.teleinc.com/", "_top");
}
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyrightNotice:ContextMenuItem = new ContextMenuItem("you right clicked", deadClick);
var mySiteLink:ContextMenuItem = new ContextMenuItem("my site", gotoMySite);
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
//full right click detection
_root.onEnterFrame = function() {
if (Key.isDown(2)) {
if (!this.wasDown) {
this.wasDown = true;
rightClick();
}
rightClickDown();
} else if (this.wasDown) {
this.wasDown = false;
rightClickUp();
}
};
function rightClickDown() {
trace("you right clicked!")
}
LOLFlash
06-03-2007, 12:54 AM
Nice script and it works
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.