0 Replies Latest reply on Jul 21, 2009 5:26 PM by allbrevard

    xml multi loader

    allbrevard

      Hello I am working with a xml loader that i downloaded, the creator was unwilling to help me mod his design so i turn to the forums.

      Here is the flash code i am working with can any one help, as i may be able to load multiple xml files into the one content window frame, so that when each different button is pressed the window reloads with the new corresponding xml file.

      This is the code used to load the current single xml file. I already have separate individual buttons created, each button loads the same window just don't know how to change the content per which button is pressed.

       

      I there a way to set up var or something? like maybe a if() then() function? How would i go about this the easyiest way?

      Thanks for all your help guys.

      [AS]

       

      Scene1:
      // RELAUNCH BUTTON
      //
      relaunchBttn2._visible = true;
      relaunchBttn2.bttn.onPress = function() {
          window_mc.showContent();
          relaunchBttn2._visible = true;
      };
      relaunchBttn._visible = true;
      relaunchBttn.bttn.onPress = function() {
          window_mc.showContent();
          relaunchBttn._visible = true;
      };


      //window_mc
      //


      // Once content and XML loaded, start transition
      onEnterFrame = function () {
           if (content_mc.xmlData.loaded) {
                showContent();
                delete onEnterFrame;
           }
      };
      stop();


      //content_mc// Where the As for the XML is

      //
      // LOAD XML
      //
      loadXML = function (loaded) {
           if (loaded) {
                xmlNode = this.firstChild;
                contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
                contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
                contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
                txt_mc.txt.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
                headerName.text = xmlNode.attributes.Name;
                setContents();
           } else {
                trace("Error loading XML");
           }
      };
      xmlData = new XML();
      xmlData.ignoreWhite = true;
      xmlData.onLoad = loadXML;
      xmlData.load("content/content.xml");
      stop();

       

       

       

       

      [/AS]