-
ContextMenu
Hello,
Code:
var menu_cm:ContextMenu = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("Save...", doSave));
function doSave(menu:Object, obj:Object):Void {
trace(" You selected the 'Save...' menu item ");
}
myBtn_btn.menu = menu_cm;
with a right click on the button named: "myBtn_btn" the menu will appear with the item "Save"
Question: I need to customize this code that whenever the user right-clicks on stage with _ymouse>300, for eaxmple,
this "Save" item appears.
-
Hi,
Maybe
PHP Code:
var menu_cm:ContextMenu = new ContextMenu(onRightClick);
var menuItemA:ContextMenuItem = new ContextMenuItem("Save...", doSave);
function doSave():Void
{
trace(" You selected the 'Save...' menu item ");
}
function onRightClick():Void
{
if (_xmouse >= 300)
{
menu_cm.customItems = [menuItemA];
}
else
{
menu_cm.customItems = [];
}
trace("right clicked x:" + _xmouse);
}
_root.menu = menu_cm;
-