title: Flex: Menubar, menu click
body: <p>I do not know why but I see that itemclick event on a menubar do not fired unless you click a sub item.</p>
  
  <p>What is the clean way to handle clicks on menuitems which are on the top level and do not have sub menu items.</p>
  
  <p>For example I want to fire an event whenever MenuItem B is clicked.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!-- menus/MenuBarControl.mxml --&gt;
  &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" &gt;
  
      &lt;mx:MenuBar id="myMenuBar" labelField="@label" itemClick="{itemClick(event)}" &gt;
          &lt;mx:XMLList&gt;
              &lt;menuitem label="MenuItem A"&gt;
                  &lt;menuitem label="SubMenuItem A-1"/&gt;
                  &lt;menuitem label="SubMenuItem A-2"/&gt;
              &lt;/menuitem&gt;
              &lt;menuitem label="MenuItem B"/&gt;
          &lt;/mx:XMLList&gt;
      &lt;/mx:MenuBar&gt;
  &lt;/mx:Application&gt;
  </code></pre>