Share on Google+Share on Google+

FlexNativeMenu Control in Flex4

The FlexNativeMenu is a MX component. It's provide a data for menu control. It has no visual representation.

FlexNativeMenu Control  in Flex4:

The FlexNativeMenu is a MX component. It's provide a data for menu control.
It has no visual representation. A FlexNativeMenu instance defines a native operating system menu such as a window menu, an application menu, a context menu etc. It used for making a menu control in AIR Application. First you will make a XML List for item and call it in a FlexNativeMenu control using dataProvider property for providing a data to the menu control . You must define a labelField="@label" property in FlexNativeMenu control tag for showing a item value in menu control. The tag of this control is <mx:FlexNativeMenu>.


<?xml version="1.0" encoding="utf-8"?>

<s:WindowedApplication xmlns:fx=""




<mx:FlexNativeMenu dataProvider="{menuItem}"






<fx:XML id="menuItem">


<menuitem label="File">

<menuitem label="New" keyEquivalent="n" controlKey="true"/>

<menuitem label="Open" keyEquivalent="o" controlKey="true"/>

<menuitem type="separator"/>

<menuitem label="Save" keyEquivalent="s" controlKey="true"/>

<menuitem label="Save as..."/>

<menuitem type="separator"/>

<menuitem label="Close"/>

<menuitem type="separator"/>

<menuitem label="Print" keyEquivalent="p" controlKey="true"/>

<menuitem type="separator"/>

<menuitem label="Quit"/>


<menuitem label="Edit">

<menuitem label="Undo" keyEquivalent="z" controlKey="true"/>

<menuitem label="Redo" keyEquivalent="r" controlKey="true"/>

<menuitem type="separator"/>

<menuitem label="Cut" keyEquivalent="x" controlKey="true"/>

<menuitem label="Copy" keyEquivalent="c" controlKey="true"/>

<menuitem label="Paste" keyEquivalent="v" controlKey="true"/>


<menuitem label="View"/>

<menuitem label="Document"/>

<menuitem label="Tools">

<menuitem label="BasicToolsSubToolBar">

<menuitem label="SelectMenuItem"/>

<menuitem label="HandMenuItem"/>

<menuitem label="ZoominMenuItem"/>

<menuitem label="ZoomDragMenuItem"/>


<menuitem type="separator"/>

<menuitem label="AnalysisToolsItem"/>


<menuitem label="Window"/>

<menuitem label="Help"/>





In this example you can see how we can use a FlexNativeMenu control  in Flex4.


Download this code


Posted on: May 25, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null