1 Reply Latest reply on Feb 14, 2008 2:47 AM by wiff77

    Next item in Array

    wiff77
      Hi guys,

      I'm new to arrays so I've probably gone about this entirely wrong but here goes. I have 9 movieclips which load in images from an xml file. This I have working but what I'd like to happen is that on the click of a button each movieclip loads the next image. There could be any number of images.

      This is the script I have so far, any suggestions would be great:

      licenseImage_xml = new XML();
      licenseImage_xml.ignoreWhite = true;
      licenseImage_xml.onLoad = function(success) {
      if (success) {
      processImage(licenseImage_xml);
      }
      };

      licenseImage_xml.load('custom/images.xml');
      var BookList:Array = new Array();
      function processImage(xmlDoc_xml) {


      BookList = xmlDoc_xml.firstChild.childNodes;

      _root.windowOne.empty.loadMovie(BookList[0].firstChild.firstChild.nodeValue);
      _root.windowTwo.empty.loadMovie(BookList[1].firstChild.firstChild.nodeValue);
      _root.windowThree.empty.loadMovie(BookList[2].firstChild.firstChild.nodeValue);
      _root.windowFour.empty.loadMovie(BookList[3].firstChild.firstChild.nodeValue);
      _root.windowFive.empty.loadMovie(BookList[4].firstChild.firstChild.nodeValue);
      _root.windowSix.empty.loadMovie(BookList[5].firstChild.firstChild.nodeValue);
      _root.windowSeven.empty.loadMovie(BookList[6].firstChild.firstChild.nodeValue);
      _root.windowEight.empty.loadMovie(BookList[7].firstChild.firstChild.nodeValue);
      _root.windowNine.empty.loadMovie(BookList[8].firstChild.firstChild.nodeValue);
      }