3 Replies Latest reply on Jan 21, 2013 1:23 PM by Flex harUI

    Submenu in flex web application ?

    muditqqq

      Can we create submenu in context menu in flex web application ?

       

      I am using flex sdk 4.5 and trying to create submenu item under context menu.

       

      1. private var myNativeMenu:ContextMenuItem = new ContextMenuItem("Menu",true);
      2. private var mysubmenu:NativeMenu = new NativeMenu();
      3. var contextMenu:ContextMenu = new ContextMenu();
      4. var subMenuItem:NativeMenuItem = new NativeMenuItem("Sub",false);
      5. subMenuItem.addEventListener(Event.SELECT, updateMe,false,0,true);
      6. mysubmenu.addItem(subMenuItem);
      7. myNativeMenu.submenu = mysubmenu;
      8. contextMenu.customItems.push(myNativeMenu);

       

      Getting following errors :-

      Line no 4.  Incorrect number of arguments. Expected no more than 0.

      Line no.6   Call to a possibly undefined method addItem

      Line no.7   Access of undefined property submenu

       

      Is it possible to create submenus in flex web app ?

       

      Thanks