Does anyone know if it's possible to use the ampersand ("&") character
in a contextmenuitem label? (i.e. as an entry in a custom 
right-click flash menu)

It appears that the underlying GUI framework interprets the "&"
character in various ways depending on OS, most of the time causing the
following character to be underlined, as if it was the hotkey for the
menu item in question.

These are some results I've observed:

Label 'Test & test':
  * On windowsxp + ff3 + FP 9:   "Test  test" 
  * On windowsxp + ie7 + FP 10:  "Test  test" 
  * On linux     + ff3 + FP 10:  "Test _test"           
  * On mac os x  + ff3 + FP 9:   "Test  test"
  * On mac os x  + safari + FP9: "Test  test"

Label 'Test && test':
  * On windowsxp + ff3 + FP 9:   "Test & test" 
  * On windowsxp + ie7 + FP 10:  "Test & test" 
  * On linux     + ff3 + FP 10:  "Test & test" with & underlined
  * On mac os x  + ff3 + FP 9:   "Test  test"
  * On mac os x  + safari + FP9: "Test  test"
   

Some sample code:
package {
    import flash.display.Sprite;
    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;

    public class test_as3 extends Sprite
    {
        public function test_as3()
        {
            var menu:ContextMenu = new ContextMenu;
            menu.customItems.push(new ContextMenuItem('1Test & test'));
            menu.customItems.push(new ContextMenuItem('2Test && test'));
            contextMenu = menu;
        }
    }
}

Should I file this as a bug on the flash player jira tracker?


Reply via email to