21 October 2005
Flash ContextMenu Gotcha
Written by Richard Leggett (
)
Published on October 21st, 2005 @ 03:06:50 pm, using 95 words, 232 views
Published on October 21st, 2005 @ 03:06:50 pm, using 95 words, 232 views
Categories: Flash
No doubt some of you have come across this. Just one for the record. It seems Flash doesn't allow certain words for labels to ContextMenuItems. "Delete", "Open" and "Save" for example.
I haven't had time to investigate fully, but the following two snippets of code on a frame will show the problem.
// Doesn't work
var cm:ContextMenu = new ContextMenu();
var cmi:ContextMenuItem = new ContextMenuItem("Delete", handler);
cm.customItems.push(cmi);
menu = cm;
function handler() {}
// Works
var cm:ContextMenu = new ContextMenu();
var cmi:ContextMenuItem = new ContextMenuItem("Delete2", handler);
cm.customItems.push(cmi);
menu = cm;
function handler() {}
