6 Replies Latest reply on Mar 25, 2007 1:28 AM by sundeep_02tv26

    help with xml  menu

    sundeep_02tv26
      hai to all,
      i am struck with a problem. plzzzzzzzzzz help
      i have 6 menus where the text is displayed from a html file.i kept the text box in a movieclip.its fine working.

      now the problem arises.
      when the mouse is over the menu the respective xml will be loaded into the flash.
      this is for menu1_mc
      on (press, rollOver) {
      _root.main("menu1.xml");
      }

      this is for menu2_mc
      on (press, rollOver) {
      _root.main("menu2.xml");
      }

      the xml will be loaded depending upon the nodes one mc here "menuItem" will be duplicated and displayed.

      menu1 it is displaying fine.but
      for the menu2_mc it is displaying the contents of the menu2 + menu1 contents

      means for menu1 there r 10 menus. ok displaying, if for menu2 there r 6 menus it is displaying the 6 menus with menu1's bottom 4 menus.

      means the menu1 contents r not erasing or they should not displayed. any help plzzzzzzzzzzzzz

      here is the code:-

      function main(path) {
      var menu:XML = new XML();
      menu.ignoreWhite = true;
      menu.load(path);
      menu.onLoad = function() {
      items = this.firstChild.childNodes;
      for (a=0; a<=items.length-1; a++)
      {
      _root.attachMovie("menuItem", "item"+a, a);
      _root["item"+a].nametxt.text = items[a].attributes.id;
      _root["item"+0]._y = 18;
      _root["item"+1]._y = 38;
      _root["item"+2]._y = 58;
      _root["item"+3]._y = 78;
      _root["item"+4]._y = 98;
      _root["item"+5]._y = 118;
      _root["item"+6]._y = 138;
      _root["item"+7]._y = 158;
      _root["item"+8]._y = 178;
      _root["item"+9]._y = 198;
      _root["item"+10]._y = 218;
      _root["item"+a]._x = 180;
      _root["item"+a].itemUrl = items[a].attributes.theurl;
      _root["item"+a].method = items[a].attributes.method;
      _root["item"+a].onRollOver = function() {
      this._x+=10;
      };
      _root["item"+a].onRollOut = function() {
      this._x-=10;

      };
      _root["item"+a].onRelease = function() {
      getURL(this.itemUrl, this.method);
      };
      }
      };
      }