0

アプリケーションのコンテキストメニューを作成しました。

if (!contextMenu) 
            {
                contextMenu = new ContextMenu();
            }

            contextMenu.hideBuiltInItems();
            contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,onContextMenuSelected);

            _cmiEdit=new ContextMenuItem("Ändern");
            _cmiEdit.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,onContextMenuItemSelected);

            _cmiDelete=new ContextMenuItem("Löschen");
            _cmiDelete.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,onContextMenuItemSelected);


            contextMenu.customItems.push(_cmiEdit,_cmiDelete);

アプリでは、最初の Contextmenuitem のみが表示され、その理由がわかりません。Air では両方が表示されます。Flashplayer バージョン 11.8

4

1 に答える 1

0

Flexのバグのようです!もう 1 つのメニュー項目「Über das Programm」でコードを開始しようとしました。新商品登場!次に、Löschenの「ö」を「oe」に変更しようとしましたが、うまくいきました!

ここに画像の説明を入力

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx" 
           minWidth="955" minHeight="600" creationComplete="init(event)">

<fx:Script>
    <![CDATA[
        import mx.events.FlexEvent;

        protected function init(event:FlexEvent):void
        {
            var _cmiEdit:ContextMenuItem;
            var _cmiDelete:ContextMenuItem;
            var _cmiAbout:ContextMenuItem;

            if (!contextMenu) 
            {
                contextMenu = new ContextMenu();
            }

            contextMenu.hideBuiltInItems();
            contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuSelected);

            _cmiEdit = new ContextMenuItem("Ändern");
            _cmiEdit.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onContextMenuItemSelected);

            _cmiDelete=new ContextMenuItem("Loeschen");
            _cmiDelete.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onContextMenuItemSelected);

            _cmiAbout=new ContextMenuItem("Über das Programm");
            _cmiAbout.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onContextMenuItemSelected);


            contextMenu.customItems.push(_cmiEdit, _cmiDelete, _cmiAbout);
        }

        protected function onContextMenuSelected(evt:ContextMenuEvent):void
        {

        }

        protected function onContextMenuItemSelected(evt:ContextMenuEvent):void
        {

        }

    ]]>
</fx:Script>

</s:Application>
于 2013-09-12T13:02:05.430 に答える