var showItem = true;
var my_cm:ContextMenu = new ContextMenu(menuHandler);
my_cm.hideBuiltInItems()
my_cm.customItems.push(new ContextMenuItem("Hello", itemHandler));
function menuHandler(obj, menuObj) {
if (showItem == false) {
menuObj.customItems[0].enabled = false;
} else {
menuObj.customItems[0].enabled = true;
}
}
function itemHandler(obj, item) {
trace("selected!");
}
this.menu = my_cm;