Create and show popup menu
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">
<mx:Script>
import mx.controls.Menu;
public var productMenu:Menu;
public function initMenu(): void
{
productMenu = Menu.createMenu(null, Products.Department);
productMenu.setStyle("disabledColor", 0xCC3366);
productMenu.show(10,10);
}
</mx:Script>
<mx:Model id="Products">
<Root>
<Department label="A">
<children label="A1" />
<children label="A2" />
<children label="A3" />
</Department>
<Department label="B">
<children label="C">
<children label="C1" />
<children label="C2" enabled="false" />
</children>
</Department>
</Root>
</mx:Model>
<mx:Button label="Show menu" click="initMenu()" />
</mx:Application>
Related examples in the same category