Machsupport Forum

Mach Discussion => Mach Screens => Flash Screens => Topic started by: azambuja on September 10, 2008, 08:01:04 AM

Title: right click in mach screen
Post by: azambuja on September 10, 2008, 08:01:04 AM
Another question, can I disable the mouse right click when running a flash screen in mach3.
Because this can interfere the user.

thanks
Title: Re: right click in mach screen
Post by: zealous on September 10, 2008, 06:52:35 PM
Hey,

To remove Content:

Code: [Select]
var rootMenu = new ContextMenu();
rootMenu.hideBuiltInItems();
_root.menu = rootMenu;

Another way to  Remove content:

Code: [Select]
Stage.showMenu = false;
Right click detect:

Code: [Select]
onEnterFrame = function () {
if (Key.isDown(2)) {
trace("Your right clicking")
    }
}

To add to the "Right Click" menu system(also including functions):

Code: [Select]
Right Click Menu
//////////////////
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();

///////////////////////////////////////////////////////////////////////////////////
var Load_menu:ContextMenuItem = new ContextMenuItem("LOAD GCODE", load_fun, true, true, true);
var edit_menu:ContextMenuItem = new ContextMenuItem("Edit GCODE", edit_fun, false, true, true);


myMenu.customItems.push(Load_menu,edit_menu);
_root.menu = myMenu;

/////////////////////////////////////
function load_fun() {
fscommand("Button", "216");
}

function edit_fun() {
fscommand("Button", "115");
}

Thanks,
Jason Blake