Flash Context Menu doesn’t allow ‘delete’
October 19th, 2007 . by polyGeekWhile doing a prototype for a usability study I was asked to customize the context menu when a user right-clicked on a specific button. No problem except one of the custom menu options they wanted was “Delete”.
Everything worked in the context menu as you might expect except everything after the “Delete” was, well, deleted. And it wouldn’t display the “Delete” either. I kept checking my code to see if there was some silent failure I wasn’t seeing and then it occurred to me, “Maybe it doesn’t like the word “Delete”.
Sure enough, that was it. Change “Delete” to anything else and it works.
Below is the code that I used: ( download source )













Yeah, right, “delete” is a reserved word since Flash Player 5 and ContextMenu does not allow its items to have labels that are equal to reserved words in Flash.
http://www.darronschall.com/weblog/archives/000102.cfm
Actually avoid using all reserved words in all your code, even in namespaces ;)
http://brianmriley.com/blog/?p=71
@JabbyPanda, thanks for the info and references.
Also ‘Open’, ‘Save’, ‘Cut’, ‘Copy’, ‘Paste’, ‘Select All’, ‘Undo’ are not available.
You can use any reserved word by appending a no break space to the end of the word. To do this, on windows type “Alt+255″ on the numeric keypad.
@Geoff, good thinking.
Leave a Reply