Hi All,
For some reason my context menus stopped working when Flash 8 came out. I
finally got them to show up but the callbacks are not firing when clicked.
Here is my code:
Any help would be appreciated.
// **** functions called by external classes ****
public function rebuildMenu(txtT:String, txtB:String, txtR:String) {
this.itemMenu = new ContextMenu();
this.itemMenu.hideBuiltInItems();
this.itemMenu.customItems.push(new ContextMenuItem(txtT, moveToTop ));
this.itemMenu.customItems.push(new ContextMenuItem(txtB, moveToBottom));
this.itemMenu.customItems.push(new ContextMenuItem(txtR, removeLayer));
this.menu = itemMenu;
}
// **** functions called from the menu ****
public function removeLayer(obj) {
//first, find the item in the array that matches clicked item
var li = obj._parent;
var leg = li.legend;
var i:Number = leg.getIndex(li);
// remove the object, and the array entry
leg.legArr[i].removeMovieClip();
leg.legArr.splice(i,1);
//respace the layers
leg.spaceLayers();
leg.callRemove(i);
}