我想在标题窗口中添加一个带有数据网格的上下文菜单,添加后没有任何反应。
[Bindable]
public var cm:ContextMenu;
private function init(event:FlexEvent):void
{
var cmi:ContextMenuItem = new ContextMenuItem("View item...", true);
cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
ontextMenuItem_menuItemSelect);
cm = new ContextMenu();
cm.hideBuiltInItems();
cm.customItems = [cmi];
}
我在标题窗口creationComplete
事件上调用init函数。
请帮助!!
答案 0 :(得分:1)
刚刚遇到过这个问题。为了让它适用于我的项目,我必须在TitleWindow上明确设置这两个:
// "this" being the TitleWindow. Doing this during creation complete event.
this.mouseEnabled = true;
this.skin.mouseEnabled = true;