Use XMLListCollection as the data model for MenuBar : Menu Model « Components « Flex
- Flex
- Components
- Menu Model
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