0 Replies Latest reply on Nov 15, 2007 1:10 PM by tj3182

    flipping through xml images

    tj3182
      I am working on a flash element that loads images from an xml file....i have multiple images and only 2 places in the flash file that i want them to appear. I need a script that will tell the flash to load a the next image in the xml file after (x) secs. Can anyone help?

      here the script i have now:

      /* set variables */
      var xPos = 0;
      function positionClip(clipName, clipX, clipY) {
      clipName._x=clipX;
      clipName._y=clipY;
      }

      /* create the XML, load number of photos */

      _level0.promosXML = new XML();
      _level0.promosXML.ignoreWhite = true;
      _level0.promosXML.load("xml/promotionsbar.xml");

      _level0.promosXML.onLoad = function() {


      /* load promotions */

      for (i=1; i<(_level0.promosXML.firstChild.childNodes[0].childNodes.length+1); i++) {

      /* create each promotion clip */
      promowrap_mc.attachMovie("promo1_mc", ["promo1_mc"+i], 1, {_x: xPos, _y: -5});

      /* load photos */
      promowrap_mc["promo1_mc"+i].createEmptyMovieClip("promo_photo", 1);
      promowrap_mc["promo1_mc"+i].promo_photo.loadMovie(["images/"+_level0.promosXML.firstChild .childNodes[0].childNodes[i-2].childNodes[0]]);
      positionClip(promowrap_mc["promo1_mc"+i].promo_photo, 4, 13);

      /* create each promotion clip */
      promowrap_mc.attachMovie("promo2_mc", ["promo2_mc"+i], 2, {_x: 222, _y: -5});

      promowrap_mc["promo2_mc"+i].createEmptyMovieClip("promo_photo", 1);
      promowrap_mc["promo2_mc"+i].promo_photo.loadMovie(["images/"+_level0.promosXML.firstChild .childNodes[0].childNodes[i-1].childNodes[0]]);
      positionClip(promowrap_mc["promo2_mc"+i].promo_photo, 4, 13);


      /* create each promotion clip */
      promowrap_mc.attachMovie("promo3_mc", ["promo3_mc"+i], 3, {_x: 529, _y: -5});

      promowrap_mc["promo3_mc"+i].createEmptyMovieClip("promo_photo", 1);
      promowrap_mc["promo3_mc"+i].promo_photo.loadMovie(["images/"+_level0.promosXML.firstChild .childNodes[0].childNodes[i-3].childNodes[0]]);
      positionClip(promowrap_mc["promo3_mc"+i].promo_photo, 4, 13);



      }
      }