加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

在flex中右键单击上下文菜单中隐藏默认选项

发布时间:2020-12-15 02:14:23 所属栏目:百科 来源:网络整理
导读:我正在开发一个flex应用程序,我想添加一个上下文菜单.我用这段代码得到了它: var myMenu:ContextMenu = new ContextMenu();myMenu.hideBuiltInItems();var defaultItems:ContextMenuBuiltInItems = myMenu.builtInItems;defaultItems.print = false;var ite
我正在开发一个flex应用程序,我想添加一个上下文菜单.我用这段代码得到了它:
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = myMenu.builtInItems;
defaultItems.print = false;

var item:ContextMenuItem = new ContextMenuItem("Go to google");
myMenu.customItems.push(item);
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelectHandler);

this.contextMenu = myMenu;

但我有一个问题.菜单显示四个默认选项(设置,关于闪光…)我想隐藏它们.使用defaultItems.print = false;我隐藏了打印选项,但我不知道如何隐藏其他选项.
有谁知道怎么做?
谢谢.

解决方法

正如 ContextMenu的参考说的那样,

You cannot remove the Settings menu
item from the context menu. The
Settings menu item is required in
Flash so that users can access the
settings that affect privacy and
storage on their computers. You also
cannot remove the About menu item,
which is required so that users can
find out what version of Flash Player
they are using.

所以你只需要使用“设置”和“关于”项目.有关其他默认项目,请参阅ContextMenuBuiltInItems的参考.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读