5 Replies Latest reply on Jul 16, 2007 9:50 AM by ntsiii

    Transfer an XML to Array to make a menu bar's dataProvider.

    JingZhe SHAN Level 1
      Hi All:
      Currently there is an XML variable transferred to the Flex application, which used to build the menuBar's data provider.
      And the structure of this XML variable may change dynamicly but will restricly follow the this pattern

      eg:
      <menuitems>
      ------<menuitem/>
      ------<menuitem>
      ------------<menuitems/>
      ------</menuitem>
      <menuitems>

      [Bindable]
      public var menuDataXML:XML =
      <menuitems>
      <menuitem label="menu2">
      <menuitems >
      <menuitem data="app1" label="ACS">
      <menuitems/>
      </menuitem>
      <menuitem data="app2" label="app2">
      <menuitems/>
      </menuitem>
      <menuitem label="menu3">
      <menuitems>
      <menuitem data="app4" label="app4">
      <menuitems/>
      </menuitem>
      <menuitem data="app3" label="app3">
      <menuitems/>
      </menuitem>
      </menuitems>
      </menuitem>
      </menuitems>
      </menuitem>
      </menuitems>;

      This XML looks like
      ----------------------------------------
      menu2----ACS
      )))))))))----app2
      )))))))))----menu3 ----app3
      ))))))))))))))))))))))) ----app4
      ----------------------------------------

      Before I use this as the menuBar's dataProvider I need make some modifications. I have to build a Array to store this XML info.
      Is there have a robust way to do this? Thanks