Skip to Main Content
Adobe AIR 1.5 Cookbook
book

Adobe AIR 1.5 Cookbook

by Rich Tretola, David Tucker, Marco Casario, Koen DeWeggheleire, Koen De Weggheleire
November 2008
Beginner to intermediate content levelBeginner to intermediate
446 pages
10h 38m
English
O'Reilly Media, Inc.
Content preview from Adobe AIR 1.5 Cookbook

Chapter 12. Application and Window Native Menus

Operating systems provide facilities for creating menus; these menus are called native menus. Adobe AIR supports working with native menus, and the recipes in this chapter show you how to build several types of native menus. At this writing, AIR supports application, window, context, and pop-up menus. Application and window menus serve the same purpose but on different platforms. Specifically, window menus are available only on Windows, and application menus are available only on Macs. Computer users are familiar with the typical native menus, so the usability of your AIR application improves a lot when you offer users application or window menus.

To create native menus, the Adobe AIR classes to use are flash.display.NativeMenu and flash.display.NativeMenuItem.

To create context menus, you can also use the classes flash.ui.ContextMenu and flash.ui.ContextMenuItem.

Note

AIR enables you to create system tray and Dock icon menus as well. See Chapter 13 for more information on these custom taskbar and Dock menus.

Creating a Native Menu

Problem

You want to create a menu for your AIR application and present the menu as an application menu or window menu depending on the user’s operating system.

Solution

Use the NativeMenu constructor to create the base menu, attach child NativeMenuItem objects, and then set the top-level base menu as the menu for the AIR application or window depending on your preference or the operating system.

Discussion

When working ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Breaking Out of the Web Browser with Adobe AIR

Breaking Out of the Web Browser with Adobe AIR

Jeff Tapper, Michael Labriola, Peter Dilillo, Tom Kaczanko, Andriy Kupriyenko, Louie Penaflor, Mike Nimer, Nathan Weber, Steve Zimmers
Adobe AIR Programming Unleashed

Adobe AIR Programming Unleashed

Stacy Tyler Young, Michael Givens, Dimitrios Gianninas

Publisher Resources

ISBN: 9780596156145Supplemental ContentErrata Page