0 Replies Latest reply on Aug 10, 2009 4:57 AM by sean_delaney

    NativeMenu not working on Windows XP but does on Mac OSX

    sean_delaney

      I have been trying to get NativeMenus to work on a AIR application for the last few hours.  On Mac OSX the menu displays fine but on Windows XP I do not see a menu.  Please advise?

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="500" height="400" creationComplete="Init();">
          <mx:Script>
              <![CDATA[
              import mx.controls.Alert;
             
              private function Init() : void {
                    var fileMenu:NativeMenuItem;
                   
                    if(NativeWindow.supportsMenu)
                    {
                       stage.nativeWindow.menu = new NativeMenu();
                      stage.nativeWindow.menu.addItem(new NativeMenuItem("File"));
                     
                      fileMenu.submenu = createFileMenu();
                  }
                  
                  if (NativeApplication.supportsMenu)
                  {
                      fileMenu = NativeApplication.nativeApplication.menu.addItem(new NativeMenuItem("File"));
                      fileMenu.submenu = createFileMenu();
                  }
              }
                      
              private function createFileMenu() : NativeMenu
              {
                  var fileMenu:NativeMenu = new NativeMenu();
                 
                     fileMenu.addItem(new NativeMenuItem("New"));

       

                  return fileMenu;
              }
              ]]>
          </mx:Script>
      </mx:WindowedApplication>