2 Replies Latest reply on May 19, 2007 9:02 AM by the_queen_is_dead

    one swf loading multiple xml?

    the_queen_is_dead
      so- I have a gallery that pulls in an xml file... I'm trying to have that gallery called and have a var as a placeholder for the xml so i can use the same .swf and any xml based on whatever button is pushed... i'm not sure how to do so- i have the gallery working fine- i just need the 'xmlData' to be dynamic... if anyone could help out- i've never had to do this before and it's a bit stressful.

      as is- and working fine... the gallery.fla has this to pull in the xml:
      xmlData = new XML();
      xmlData.ignoreWhite = true;
      xmlData.onLoad =loadXML;
      xmlData.load("xml/projects.xml");

      i just need to figure out how to have the buttons in a master.swf open the gallery.swf and a corresponding .xml file... which i know how to do in the master.fla- i just don't know how to set up the second fla to parse the corresponding xml based on which button is pushed... would i set up an array that included all the possible xml files?

      pretty much this is what i'm trying to make happen:
      projects_mc.onRelease - loads gallery.swf with projects.xml
      staff_mc.onRelease - loads gallery.swf with staff.xml
      etc...

      thanks for reading!
        • 1. Re: one swf loading multiple xml?
          joeschmoesdf Level 1
          If i understand correctly...

          there are 2 options

          number one -

          use the loadmove function with 2 swf's

          ex:
          on(release) {
          loadmovie("1.swf", 0)
          }

          One frame 1 of the 1.swf put in the as:

          xmlData2 = new XML();
          xmlData2.ignoreWhite = true;
          xmlData2.onLoad =loadXML;
          xmlData2.load("xml/projects2.xml");

          then do the same for the second button (easier if there small files i think)

          solution 2 (more problematic) -

          use the loadmove function with 1 swf

          ex:
          on(release) {
          var xmlfile = "1"
          loadmovie("1.swf", 0)
          }

          One frame 1 of the 1.swf put in the as:

          if xmlfile = 1 {

          xmlData2 = new XML();
          xmlData2.ignoreWhite = true;
          xmlData2.onLoad =loadXML;
          xmlData2.load("xml/projects2.xml");
          } else {
          xmlData3 = new XML();
          xmlData3.ignoreWhite = true;
          xmlData3.onLoad =loadXML;
          xmlData3.load("xml/projects3.xml");
          }
          • 2. Re: one swf loading multiple xml?
            the_queen_is_dead Level 1
            Heyya- Thanks so much for the direction!!! That really helps out- I think I'm going to have to go with the second option- as the first... I'm able to do- just was trying to avoid having many extra .swf's... Would option two still be the best if I have say- around 20 different galleries?