Of course, you would replace the example XML the XML that is 
returned from your data service.

-TH

--- In [email protected], "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> Here's one way to do it.  The cool thing is that, in this example, 
the
> XML enabled attribute actually binds to the control's enabled 
property
> (good thinking Adobe).  If you're using Cairngorm, you can also 
use this
> method to dispatch XML defined menu events.
> 
> Cheers,
> Tim Hoff
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
>      width="100%" height="100%">
> 
>      <mx:Script>
>            <![CDATA[
> 
>                  import mx.events.MenuEvent;
>                  import org.ets.main.code.model.ModelLocator;
>                  import org.nevis.cairngorm.control.CairngormEvent;
> 
>                  private function handleTopMenu
(event:MenuEvent):void
>                  {
>                      var cairngormEvent:CairngormEvent = new
> CairngormEvent([EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> );
>                      dispatchEvent(cairngormEvent);
>                  }
> 
>             ]]>
>      </mx:Script>
> 
>      <mx:XML format="e4x" id="topMenuData">
>          <root>
>               <menuitem label="Search" enabled="true">
>                    <menuitem label="Authors" enabled="true"
> event="showSearchAuthors"/>
>                    <menuitem label="Plagiarists" enabled="false"
> event="showSearchPlagiarists"/>
>               </menuitem>
>               <menuitem label="Reports" enabled="true">
>                    <menuitem label="Authors" enabled="true"
> event="printAuthors"/>
>                    <menuitem label="Plagierists" enabled="false"
> event="printPlagiarists"/>
>               </menuitem>
>           </root>
>      </mx:XML>
> 
>      <mx:ApplicationControlBar width="100%">
>            <mx:MenuBar id="topMenuBar"
>                   height="100%" width="100%"
>                   dataProvider="{topMenuData}"
>                   showRoot="false" labelField="@label"
>                   change="handleTopMenu(event);">
>            </mx:MenuBar>
>      </mx:ApplicationControlBar>
> 
> </mx:Canvas>
> 
> 
> 
> --- In [email protected], "Wally Randall" <wally.randall@>
> wrote:
> >
> > I have a large menu with about 100 different nodes and sub-
nodes. I
> > am trying to design a means of enabling the menu nodes at run-
time
> > rather than hardcoded in the mxml menu application.
> >
> > I envisage having the menu call a ColdFusion CFC to dynamically 
build
> > the menu menubarXML list with the user-specific options enabled 
from
> > the Application creationComplete event.
> >
> > Does anyone have an example of how to do this in AS3?
> >
> > Is this the best way of handling this type of menu?
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to