AIR 鼠标右击

     //鼠标右击菜单  
   var mainMenu:NativeMenu = new NativeMenu();
   var minimizeMenu:NativeMenuItem = new NativeMenuItem("Minimize");
   var maximizeMenu:NativeMenuItem = new NativeMenuItem("Maximize");
   var sepMenu:NativeMenuItem = new NativeMenuItem("",true);
   var restoreMenu:NativeMenuItem = new NativeMenuItem("Restore");
   var closeMenu:NativeMenuItem = new NativeMenuItem("Close");
   minimizeMenu.addEventListener(Event.SELECT, handleMenuClick);
   maximizeMenu.addEventListener(Event.SELECT, handleMenuClick);
   restoreMenu.addEventListener(Event.SELECT, handleMenuClick);
   closeMenu.addEventListener(Event.SELECT, closeApp);
   mainMenu.addItem(minimizeMenu);
   mainMenu.addItem(maximizeMenu);
   mainMenu.addItem(sepMenu);
   mainMenu.addItem(restoreMenu);
   mainMenu.addItem(closeMenu);
   this.contextMenu=mainMenu;
   }
//   private function handleMenuClick(event:Event):void{
//    
//   }

    private function closeApp(event:Event):void {
     event;  
     this.nativeWindow.close();
    } 

posted @ 2009-08-27 17:17  zhych  阅读(221)  评论(0编辑  收藏  举报