<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <s:layout> <s:VerticalLayout/> </s:layout> <fx:Declarations> <s:XMLListCollection id="menuData"> <s:source> <fx:XMLList xmlns=""> <menuitem label="Tasks"> <submenu label="Add Request"/> <submenu label="Add Person"> <submenu label="Customer"/> <submenu label="Employee"/> </submenu> </menuitem> </fx:XMLList> </s:source> </s:XMLListCollection> </fx:Declarations> <s:Button label="Display Menu" click="menu.show()"/> <mx:Menu id="menu" showRoot="true" labelField="@label" dataProvider="{menuData}"/> </s:Application>