You'll have to add a "click" event & attach a method to it. Within 
the method, the first thing you gotta check is whether the clicked 
item is of type menubarItem. If it is then go ahead & compare the 
labels & write your actions accordingly. For label comparison, use 
something like "[EMAIL PROTECTED]" .
  Hope this solves your issue.

Regards,
Robi.

--- In [email protected], "gamecocked" <[EMAIL PROTECTED]> 
wrote:
>
> I have a menubar that uses an xml list as the dataprovider..below 
is a
> sample...
> <mx:XMLList id="TopMenu">
>       <menuitem label="New  " data="top" icon="NewIcon">
>               <menuitem label="Request" data="NewRequest"/>
>             <menuitem label="Reboot" data="NewReboot"/>
>         </menuitem>                
>         <menuitem label="Edit  " data="Edit" icon="EditIcon"
> type="normal">
>         </menuitem>
>         <menuitem label="Print  " data="Print" icon="PrintIcon">
>         </menuitem>
>         <menuitem label="Search  "   data="Search" icon="FindIcon">
>         </menuitem>
>         <menuitem label="Calendar  "   data="Calendar"
> icon="CalendarIcon">
>         </menuitem>   
> 
> and I call a menuhandler function...that looks at the @data tag of 
the
> xml and then runs another function to open a new window...
> 
> private function menuHandler(event:MenuEvent):void {
>                 if([EMAIL PROTECTED] == "NewRequest") {              
>                     showNewRequestWindow();
>                 }
>                 else if([EMAIL PROTECTED] == "Edit") {
>                       showEditRequestWindow();
>                 }
>                 else if([EMAIL PROTECTED] == "Print") {
>                       getUrl();
>                 }
>                 else if([EMAIL PROTECTED] == "HelpUsersGuide") {
>                       showAboutWindow();
>                 }
> 
> The issue is that I get no event when clicking on the menu item that
> has no children like "Edit" from above....so how do I get the
> information from the parent menu item to be able to run another 
function?
> 
> Ed
>


Reply via email to