views:

42

answers:

1

I have a problem with the following Flash AS3-code:
When I change "Delete1" to "Delete", the menu item disappears.
When I call it anything else but delete, then it reappears.
Why? It also occurs when I comment out hideBuiltInItems...

// create new context menu
var mymenu:ContextMenu = new ContextMenu();
mymenu.hideBuiltInItems(); // hide items like Zoom, Play, Loop etc

// create new menu item and add it to the right click menu
var frame2item:ContextMenuItem = new ContextMenuItem("Delete1");
frame2item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doFrame2);
mymenu.customItems.push(frame2item);
+2  A: 

See the documentation of ContextMenuItem. You can't use Delete. It's probably a waste of time to circumvent it; consider renaming it something more specific, like "Delete Ash Diffusers". From the documentation:

The following captions are not allowed, but the words may be used in conjunction with other words to form a custom caption (for example, although "Paste" is not allowed, "Paste tastes great" is allowed):

  • Save
  • Zoom In

[...]

  • Delete
Jesse Millikan