<mx:cavas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" creationComplete="init();">
private var newBuildMenuItem: ContextMenuItem;
internal function init(): void{
treeMenu();
}
private function treeMenu(): void{
createTreeMenuItem();
tree.contextMenu = getTreeContxtMenu();
}
public function createTreeMenuItem(): void{
newBuildMenuItem = new ContextMenuItem("新建");
newBuildMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, newBuildHandler);
}
private function getTreeContxtMenu(): ContextMenu{
var contextMenu: ContextMenu = new ContextMenu();
contextMenu.hideBuiltInItems();
contextMenu.customItems.push(newBuildMenuItem);
return contextMenu;
}
flex tree加入右键菜单
最新推荐文章于 2025-01-15 13:17:21 发布
本文介绍如何使用Adobe Flash CS5及ActionScript 3.0 (AS3) 创建自定义的上下文菜单。通过具体代码示例展示了如何为树形结构的节点添加“新建”选项,并实现相应的事件处理。
852

被折叠的 条评论
为什么被折叠?



