Using a nested array to drive a menu
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" >
<mx:Script>
public var myMenuData:Array = [ { label:'New', children:[
{label:'File'},
{label:'Open'},
{label:'Save'}] },
{label:'Edit', children:[
{label:'Cut'},
{label:'Paste'},
{label:'Copy'}] } ];
</mx:Script>
</mx:Application>
Related examples in the same category