3 Replies Latest reply on Jul 17, 2012 4:51 AM by Ned Murphy

    Switching XML sheets

    DMB89

      Hi people. I will try and explain as simply as possible on this one...

       

      i have the following AS2 script:

       

      ManualPlay.onRelease = function(){

          myXML.load("../../config/settings/page_list.xml");

          _global.xmlVersion = assets;

          trace(xmlVersion);

      }

      AutoPlay.onRelease = function(){

          myXML.load("../../config/settings/page_list_auto.xml");

          _global.xmlVersion = assets_auto;

          trace(xmlVersion);

      }

       

      i then have another script that detects if the xmlVersion is assets_auto and if true stop the timeline else continue playing:

       

      stop();

       

      if (_global.xmlVerson == assets_auto)

      {

          trace("auto mode");

           _root.gotoAndPlay(2);

      }

      else

      {

           trace("manual mode");

          play();  

      }

       

      All the traces seem to come back correct but the actions dont seem to take affect. it always goes to manual mode and the timeline continues to play.

       

      i think i need to convert the assets_auto etc value to a string or something but i dont really understand what i need to do.

       

      any help will be amazing thank you

        • 1. Re: Switching XML sheets
          Ned Murphy Adobe Community Professional & MVP

          If you do not have quotations around your "assets" and "assets_auto" everywhere they appear, then you probably need to, unless those are names of variables that have other values assigned somewhere else.

          • 2. Re: Switching XML sheets
            DMB89 Level 1

            i tried with the "" but no luck.

             

            They are just used do determine where to look for SWF files eg:

             

            loadMovie("config/"+ xmlVersion +"/"+nextslide, slidePlayer);

             

            however in my timeline there is a section i dont want to play if xmlVersion == assets_auto.

             

            however it just keeps ignoreing this bit of script.

            • 3. Re: Switching XML sheets
              Ned Murphy Adobe Community Professional & MVP

              You should trace the value of _global.xmlVersion just before the conditional to see what it is...

               

              stop();

               

              trace(_global.xmlVersion)

               

              if (_global.xmlVerson == "assets_auto")

               

              and if you are still missing the quotes which I show above, they need to be there (the forum does remove quotes at times)