4 Replies Latest reply on Dec 30, 2010 8:57 AM by learner_doug

    Simple Way to Detect a MenuItem Click?

    ShedoSurashu

           I'm having some trouble finding a way to make this simple setup display an identifier for whatever menuitem the user clicked.

       


              <mx:MenuBar id="topMenuBar" labelField="@label">
                  <fx:XMLList>
                      <menuitem label="File">
                          <menuitem label="New Document"/>
                          <menuitem label="Update Document"/>
                          <menuitem type="separator" />
                          <menuitem label="Print" />
                          <menuitem type="separator" />
                          <menuitem label="Login / Logout" />
                      </menuitem>
                      <menuitem label="Categories">
                          <menuitem label=""/>
                      </menuitem>
                      <menuitem label="MenuItem C"/>
                      <menuitem label="MenuItem D">
                          <menuitem label="SubMenuItem D-1"
                                    type="radio" groupName="one"/>
                          <menuitem label="SubMenuItem D-2"
                                    type="radio" groupName="one"
                                    selected="true"/>
                          <menuitem label="SubMenuItem D-3"
                                    type="radio" groupName="one"/>
                      </menuitem>
                  </fx:XMLList>
              </mx:MenuBar>

       

      Can anyone bring some light into my problem? I just want to be able to make that menu come display via Alert.show an identifier for whichever o the above menu gets clicked by the user.

       

      E.g.

      When the user clicks on File > New Document, it should come up with an alert showing File > New Document or something to let me identify that the user indeed clicked on that menuitem.