Skip to main content
Known Participant
November 7, 2014
Answered

How to remove default menu items in a Mac Air application

  • November 7, 2014
  • 1 reply
  • 935 views

Hi Everybody,

I have a Air application built in Flash Builder which runs on Windows as well as in Mac.

My application has it's own menu bar. In windows it's OK.

But in Mac above my app's menu bar there is a default Mac app menu bar with four items(App Name, File, Edit, Windows), which is totally unnecessary.

I want to remove the Mac's default app menu bar.

Please help.

Thanks in advance,

Jameel

This topic has been closed for replies.
Correct answer

You can remove them using the NativeApplication.nativeApplication.menu property to access the native menu.

import flash.desktop.NativeApplication;

if (NativeApplication.nativeApplication.supportsMenu) {

     NativeApplication.nativeApplication.menu.removeAllItems();

}

The ASDocs says this removes all menu items, but I imagine it will leave the "App Name" menu item on Mac OS computers so the user will know what app is currently active and so it can be closed or hidden.

NativeMenu - Adobe ActionScript® 3 (AS3 ) API Reference

NativeApplication - Adobe ActionScript® 3 (AS3 ) API Reference

1 reply

Correct answer
November 7, 2014

You can remove them using the NativeApplication.nativeApplication.menu property to access the native menu.

import flash.desktop.NativeApplication;

if (NativeApplication.nativeApplication.supportsMenu) {

     NativeApplication.nativeApplication.menu.removeAllItems();

}

The ASDocs says this removes all menu items, but I imagine it will leave the "App Name" menu item on Mac OS computers so the user will know what app is currently active and so it can be closed or hidden.

NativeMenu - Adobe ActionScript® 3 (AS3 ) API Reference

NativeApplication - Adobe ActionScript® 3 (AS3 ) API Reference

Known Participant
November 10, 2014

Hi,

Thanks for the reply.

I will try this out.


Regards,

Jameel