var expandmenu = new ContextMenu(); function f1_func() { tab1.enabled = false; } function f2_func() { tab1.enabled = true; } expandmenu.hideBuiltInItems(); var tab1 = new ContextMenuItem("把我变成灰色", f1_func); var tab2 = new ContextMenuItem("把它变回来", f2_func); expandmenu.customItems.push(tab1, tab2); _root.menu = expandmenu;