3 Replies Latest reply on Mar 11, 2010 6:40 PM by Ned Murphy

    xml problem?

    auto_ghost Level 1

      lash player 8
      actionscript 2.0

      loading animation
      xml loaded...
      PUSHED
      PUSHED
      PUSHED
      PUSHED
      PUSHED
      PUSHED


      this is the message that pops up everytime I try to test movie! I've tried everywhere to find a solution and maybe some-one on here can help me out.

      basically i've been given the flash file of a website to edit, and and then the ftp details of the actual site. So i've dowloaded all the info from the ftp account, tried to use the swf from the flash file i have and it will load the opening scene but won't load the xml driven content! and i get a actionscript pop up window with the message above.

      I've checked where the actionscript is pointing to (e.g. actionscript/loader.as)
      and everything should work but doesn't.

       

      here's the script:

       

      /*
         #############################################################
         ##   Load and process XML                                  ##
         #############################################################
      */

       

      // ------------------------------------------------------------- [ Load XML ] ----------------------------------
      var xmlfile:XML = new XML();
      loadXML = function () {
          _root.xmlfile.load("pjp.xml");
          _root.xmlfile.ignoreWhite = true;
          _root.xmlfile.onLoad = function(success) {
              if (success) {
                  trace("xml loaded...");
                  makeArray();
              } else {
                  trace("xml load failed...");
              }
          };
      }

       

       

       


      // ------------------------------------------------------------- [ Convert to multi-dimensional arrays ] -------
      /*
          navButtons = [
          ["submenu1_mc",
              ["galleries_mc", "GALLERIES"],
              ["advertising_mc", "ADVERTISING", 0],    // [button clip, button title, image category]
              ["editorial_mc", "EDITORIAL", 1],
              ["lifestyle_mc", "LIFESTYLE", 2],
              ["personal_mc", "PERSONAL", 3],
              ["manipulation_mc", "MANIPULATION", 4],
              ["clients_mc", "CLIENTS", 5],
              ["viewall_mc", "VIEW ALL", 6]
          ],
          ["submenu2_mc",
              ["showreels_mc", "SHOWREELS", ],
              ["show1_mc", "SHOWR SUB ONE", 7],
              ["show2_mc", "SHOWR SUB TWO", 8],
              ["show3_mc", "SHOWR SUB THREE", 9]
          ],
          ["studios_mc", "STUDIOS"],
          ["shadowplay_mc", "SHADOWPLAY"],
          ["bio_mc", "BIO"],
          ["contact_mc", "CONTACT"]
      */

       

      makeArray = function() {
         
          pages = new Array();
          nodes = xmlfile.firstChild.childNodes;//[0].childNodes;
             
          // Build navigation menu array
          navButtons = new Array();
          imageArray = new Array();
          var categoryNum = 1;  // first category (gets incremented in loop)
         
          // Loop through 'menuOption' XML nodes
          for(i=0;i<nodes.length;i++) {
             
              var menuOption = nodes[i];
             
              navButtons[i] = new Array();
         
              // Process options with submenus
              if (menuOption.attributes.submenumc) {
                 
                  navButtons[i][0] = menuOption.attributes.submenumc;  // submenu clip
                  navButtons[i][1] = new Array();
                  navButtons[i][1].push(menuOption.attributes.buttonmc);  // submenu button clip
                  navButtons[i][1].push(menuOption.attributes.name);  // submenu button title
                 
                  // Submenu options (categories)
                  var subOptions = menuOption.childNodes;
                 
                  for (var j=0; j<subOptions.length; j++) {
                     
                      navButtons[i][j+2] = new Array();
                      navButtons[i][j+2].push(subOptions[j].attributes.buttonmc);
                      navButtons[i][j+2].push(subOptions[j].attributes.name);
                      //
                      navButtons[i][j+2].push(categoryNum);  // category number for this button
                     
                      // Add items (images/video) for this category to 'imageArray'
                      var subItems = subOptions[j].childNodes;
                     
                      imageArray[categoryNum] = new Array();
                      imageArray[categoryNum].push(subOptions[j].attributes.name);  // category name at index 0
                     
                      //trace(subOptions[j].attributes.name);
                     
                     
                      // Add linkage
                      if (!subItems.length) {
                          navButtons[i][j+2].push(subOptions[j].attributes.linkage);
                          //trace (subOptions[j].attributes.linkage);
                      }
                     
                     
                      for (var k=0; k<subItems.length; k++) {
                          var client = subItems[k].childNodes[0].firstChild.nodeValue;
                          var text = subItems[k].childNodes[1].firstChild.nodeValue;
                          var file = subItems[k].childNodes[2].firstChild.nodeValue;
                          var type = subItems[k].childNodes[2].nodeName;
                          //
                          imageArray[categoryNum].push({client:client, text:text, file:file, type:type});
                      }
                      categoryNum++;
                  }
                 
              } else {
                 
                  // Process options without submenus
                  navButtons[i] = new Array();
                  navButtons[i].push(menuOption.attributes.buttonmc);  // submenu button clip
                  navButtons[i].push(menuOption.attributes.name);  // submenu button title
                  navButtons[i].push(menuOption.attributes.linkage);  // submenu button page linkage
                 
              }
             
          }
         
          // Clean up
          delete nodes;
          delete xmlfile;
         
          // XML loaded and processed
          doNavigation();

       

      };

       

      loadXML();

       


      please can someone help?

      Phil

        • 1. Re: xml problem?
          Ned Murphy Adobe Community Professional & MVP

          That output is probably normal.  It looks to be trace results from the processing.  Only one line of it is found in the code you show (that I can see)... trace("xml loaded...");    so the rest are probably in code that you have yet to discover.  But those traces are more likely good news, since traces are primarily for that purpose... to show the designer what is working and what is not.

           

          If you are having a problem with something not working, then you need to explain what isn't happening.  The traces are indicating what is (or should be) happening properly.

          1 person found this helpful
          • 2. Re: xml problem?
            auto_ghost Level 1

            basically what isn't happening is that none of the animations preview when i go

             

            control>testmovie

             

            I just get a pop up with the message telling me its working ok, (loading animation xml loaded... PUSHED) but i'd rather it didn't tell me and just load the animation!

             

            This is really frustrating as all i want to do is to make a few colour changes inn the .fla but I can't preview it to see if it looks good!

             

            Is there anything you would need to help with this? I at my wits end trying to get to the bottom of it!

            • 3. Re: xml problem?
              Ned Murphy Adobe Community Professional & MVP

              It is possible you are missing some other file that this swf relies on where you have the files now, so it cannot get past some point in the setup progression.  Maybe some of the content specified by the xml are not targeted properly the way you have things configured.

               

              If your changes do not involve editing code, I suggest just making the color changes you intend to and place the file on the server to view it where it will likely perform properly.  You could temporarily place it in a differently named web page parallel to the one currently on the server so that everything it needs is present yet only you will have a link to view it.

              1 person found this helpful