
Menus
Flex also has support for menus, including those that appear
at the top of the window as well as pop-up menus. Exam-
ple 4-16 shows how to create a menu bar along the top of the
window.
Example 4-16. Menu.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:MenuBar labelField="@label">
<mx:XMLList>
<menuitem label="File">
<menuitem label="New" />
<menuitem label="Open"/>
</menuitem>
<menuitem label="Edit"/>
<menuitem label="Source"/>
</mx:XMLList>
</mx:MenuBar>
</mx:Application>
When I run this in Flex Builder I see something similar to
Figure 4-16.
58 | Chapter 4: Flex Controls and Layout
Commenti su questo manuale