2 Replies Latest reply on Mar 19, 2009 9:59 AM by Jeff Swartz

    Access the "About {app}" dialog in Windows?

    sfsam
      On the Mac, there is an About {app} dialog accessible from the main menu. It shows the app name, version and optionally some descriptive info. Does this dialog exist on Windows and if so, how do we access it? I'd like to have the functionality of an "About" dialog on both platforms.
      Thanks.
        • 1. Re: Access the "About {app}" dialog in Windows?
          Jeff Swartz Level 3
          You can add an About {app} command using the NativeMenu class.
          • 2. Re: Access the "About {app}" dialog in Windows?
            Jeff Swartz Level 3
            Here's some basic ActionScript code:

            if (NativeWindow.supportsMenu) {
            var root:NativeMenu = new NativeMenu();
            stage.nativeWindow.menu = root;
            var helpMenu:NativeMenu = new NativeMenu();
            var aboutCommand:NativeMenuItem = new NativeMenuItem("About");
            aboutCommand.addEventListener(Event.SELECT, aboutSelected);
            helpMenu.addItem(aboutCommand);
            root.addSubmenu(helpMenu, "Help");
            }

            function aboutSelected(event:Event):void {
            var windowInitOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
            var aboutHTML:HTMLLoader = HTMLLoader.createRootWindow(false);
            aboutHTML.loadString("<h1>My Application Name</h1><p>(c)2009 My Company, Inc</p>");
            var aboutWindow:NativeWindow = aboutHTML.stage.nativeWindow as NativeWindow;
            aboutWindow.bounds = new Rectangle(200, 200, 400, 200);
            aboutWindow.visible = true;
            }