Recently I attempted at add copy, paste, delete to a ContextMenu (rt-click menu) of a Flash movie. I quickly discovered that copy, paste, and delete are reserved words and cannot be used. I tried the trick of putting a space after the words, i.e. "copy ". That did not work.
I found a decent work around. I added a non-breaking space to the end of each string and that was enough of a change to get copy, paste, and delete to show up in my context menu. The unicode character for a non-breaking space is 00A0. The syntax looks like this "\u00A0".
elementContextMenu = new ContextMenu(); elementContextMenu.hideBuiltInItems(); var cutItem:ContextMenuItem = new ContextMenuItem("Cut\u00A0"); var copyItem:ContextMenuItem = new ContextMenuItem("Copy\u00A0"); var pasteItem:ContextMenuItem = new ContextMenuItem("Paste\u00A0"); cutItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onCutItem); copyItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onCopyItem); pasteItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onPasteItem); elementContextMenu.customItems.push(cutItem); elementContextMenu.customItems.push(copyItem); elementContextMenu.customItems.push(pasteItem); Application.application.contextMenu = elementContextMenu;
[...] Recently I attempted at add copy , paste , delete to a ContextMenu (rt-click menu) of a Flash movie. More: Flash ContextMenu [...]
[...] Source: http://www.themorphicgroup.com/blog/2009/07/06/contextmenu-copy-paste-delete/ [...]
Good work. It will be very useful.