0 Replies Latest reply on Dec 6, 2006 12:35 AM by garrycrowfoot

    renaming external config.xml file

    garrycrowfoot
      I need help renaming an .xml file used by a Flash movie.

      I have created a series of animations using a template provided by the client. This template consists of a "master" file which contains logos, stop/pause buttons, sound slider etc., plus 3 .swf files that are launched when one of the 3 button options is clicked ("welcome", "view demo", "contacts").

      The master file uses a file called config.xml to manage the relations with the individual .swf files. However, the client's website Content Management System renames .xml files as .html files, with the result that the 3 .swf files no longer play when the viewer clicks on the appropriate button.

      The client has asked if we can rename the config.xml file and modify appropriately the actionscript in the master file. I have tried and failed and would appreciate some expert advice. I have attached the actionscript (below) for reference.

      Best regards,
      Garry

      fscommand("allowscale", false);
      productName = "";
      welcomeFileName = "";
      demoFileName = "";
      contactFileName = "";
      myXMLLoaded = false;


      //Load XML ----------------------------------------
      function myLoad(ok) {
      if (ok == true) {
      parseXML();
      myXMLLoaded = true;
      trace("XML LOAD OK");
      }
      }

      config = new XML();
      config.ignoreWhite = true;
      config.onLoad = myLoad;
      config.load("config.xml");
      sectionArray = new Array();

      function parseXML() {
      productName = config.firstChild.firstChild.childNodes;
      //trace ("productName: " + productName);
      welcomeFileName = config.firstChild.firstChild.nextSibling.childNodes;
      //trace ("welcomeFileName: " + welcomeFileName);
      demoFileName = config.firstChild.firstChild.nextSibling.nextSibling.childNodes;
      //trace ("demoFileName: " + demoFileName);
      contactFileName = config.firstChild.firstChild.nextSibling.nextSibling.nextSibling.childNodes;
      //trace ("contactFileName: " + contactFileName);
      sections = config.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nodeName;
      //trace ("sections: " + sections);
      if (sections != null) {
      //trace("NOT NULL");
      sectionLength = config.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.childNodes.l ength;
      //trace ("sectionLength: " + sectionLength);
      for (n=0; n < sectionLength; n++) {
      thisSection = config.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.childNodes[n ].childNodes;
      //trace ("section: " + thisSection);
      sectionArray[n] = thisSection;
      }
      }
      }


      //-------------------------------------------------
      Script = "Loading...";

      //---Functions-------------------------------------
      function forwardDemo() {
      trace("FORWARD");
      thisFrame = dropZone._currentframe;
      dropZone.gotoAndPlay(thisFrame + 100);
      _root.Navigation.gotoAndStop("playing");
      }

      function rewindDemo() {
      trace("REWIND");
      thisFrame = dropZone._currentframe;
      n = 100;
      if (thisFrame > n) {
      dropZone.gotoAndPlay(thisFrame - n);
      _root.Navigation.gotoAndStop("playing");
      }
      }

      function pauseDemo() {
      trace ("PAUSED");
      dropZone.stop();
      }

      function playDemo() {
      trace ("PLAYING");
      dropZone.play();
      }