views:

1024

answers:

1

In my project i used this below function

    public function createIconMenu():NativeMenu{
  var iconMenu:NativeMenu = new NativeMenu();
iconMenu.addItem(new NativeMenuItem("", true));//Separator
  if(NativeApplication.supportsSystemTrayIcon){
   iconMenu.addItem(showCommand);
   showCommand.addEventListener(Event.SELECT, onShowCommand);  
   iconMenu.addItem(new NativeMenuItem("", true));//Separator  
   var exitCommand: NativeMenuItem = iconMenu.addItem(new NativeMenuItem("Exit"));
   exitCommand.addEventListener(Event.SELECT, exit); 
  }  


   return iconMenu;
 }

 public function exit(event:Event):void{
  NativeApplication.nativeApplication.exit();
 }

but on this public function exit shows error like 1024: Overriding a function that is not marked for override.

what did i wrong code ? . could u explain me ?

+1  A: 

Rename the exit function to something else. This is colliding with another function in the global namespace that is provided by the system and cannot be overridden by the user.

dirkgently
if u rename exit function then not working exitCommand.addEventListener(Event.SELECT, exit);how to exit NativeApplication ..
R.Vijayakumar
thanks for response me dirkgently
R.Vijayakumar
i got it . thank you so much dirkgently . it's very useful to me
R.Vijayakumar