21 Replies Latest reply on Jul 11, 2009 2:06 PM by kglad

    help loading list of img

    itays

      hi to all,

      need help asap. i have wasted almost two days on that.

      im loading a list of img urls from xml file:

            <image>

              <item><![CDATA[http://www.thelatest.co.il/images/tags/court.png]]></item>

              <item><![CDATA[http://www.stockvault.net/images/sv08/random/firepit.jpg]]></item>

              <item><![CDATA[http://www.stockvault.net/images/sv08/random/cloudysun.jpg]]></item>

              <item><![CDATA[http://www.stockvault.net/images/sv08/random/cloudysun.jpg]]></item>

              <item></item>

              <item></item>

              <item></item>

              <item></item>

            </image>

       

      the loading code:

       

      xmlData = new XML ;

      xmlData.ignoreWhite = true;

      xmlData.onLoad = loadXML;

      var xmld = winvar.text;

      xmlData.load(p + "my.xml");

      pics = new Array();

       

      function loadXML()

      {

      if (xmlData.loaded)

      {

      xmlNode = this.firstChild.firstChild.childNodes;

      total = xmlNode.length;

      pics = [];

      for(k=0;k<xmlNode[0].childNodes[3].childNodes.length;k++)

      {

      if(xmlNode[0].childNodes[3].childNodes[k].firstChild.nodeValue != null)

      {

      //trace(xmlNode[0].childNodes[3].childNodes[k].firstChild.nodeValue);

      pics[k] = xmlNode[0].childNodes[3].childNodes[k].firstChild.nodeValue

      }

      }

       

      }

      }

       

      the urls enters into an array and loading mc with interval. the interval code:

       

       

      var count = 0;

      function picsinterval()

      {

      clearInterval(myInterval);

      clearInterval(loadInterval);

      trace(pics[count] + " - " + count);

      imagea.clear();

      imagea.loadMovie(pics[count]);

       

      if(count == 7)

      {

       

      clearInterval(myInterval);

      count = 0;

      myInterval = setInterval(picsinterval,3000);

      _root.pg.gotoAndPlay(2);

       

      }

      else

      {

      count++;

      myInterval = setInterval(picsinterval,3000);

      _root.pg.gotoAndPlay(2);

      }

       

      }

       

      now, the problem is that only imges in the array that located in 1,3,4 etc position are loaded,

      and the mc ignores the imges in 0,2,4 positions.

       

      any body have a clue?