Use XMLListCollection as the data model for MenuBar : Menu Model « Components « Flex






Use XMLListCollection as the data model for MenuBar

Use XMLListCollection as the data model for MenuBar
      
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:MenuBar labelField="@label">
        <mx:XMLListCollection>
            <mx:XMLList>
                <item label="File">
                    <item label="New" />
                    <item label="Open" />
                    <item label="Close" />
                    <item label="Properties" />
                </item>
                <item label="Edit">
                    <item label="Select All" />
                    <item label="Copy" />
                    <item label="Cut" />
                    <item label="Paste" />
                </item>
            </mx:XMLList>
        </mx:XMLListCollection>
    </mx:MenuBar>
    
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Create a Menu that uses an Array data providerCreate a Menu that uses an Array data provider
2.Use to define the data for the Menu controlUse <mx:XML> to define the data for the Menu control
3.Provide Data for MenusProvide Data for Menus
4.Array DataProvider for MenuArray DataProvider for Menu
5.An XML menu data provider with iconsAn XML menu data provider with icons
6.The dataProvider property is the default property of the MenuBar controlThe dataProvider property is the default property of the MenuBar control
7.Create MenuBar from XMLListCreate MenuBar from XMLList
8.Create menu from XMLCreate menu from XML
9.Create Menu from ArrayCreate Menu from Array
10.Define XML or XMLList object as a direct child of the Define XML or XMLList object as a direct child of the <mx:MenuBar>
11.Dynamically Populate MenusDynamically Populate Menus
12.Model With MenuModel With Menu