3 Replies Latest reply on Jun 15, 2007 8:24 AM by SymTsb

    XML loaded thumb placement

    za beezo
      I am trying to adapt the code from:

      No problems there, but I am trying to group the thumbs into groups of twos place one group below another based on the amount of thumbs in the XML (So I need to use (i) to get the count): group of two w/ each proceeding group under the first... I realize I have a number (i), but I cannot think of a way to split the thumbs into groups of two for a new _x. Obviously I cannot use a for statement because the amount of thumbs will change. Any ideas would be greatly appreciated- thanks in advance...


      myPhoto = new XML();
      myPhoto.ignoreWhite = true;
      myPhoto.onLoad = function(success) {
      numimages = this.firstChild.childNodes.length;
      spacing = 70;
      for (i=0; i<numimages; i++) {
      picHolder = this.firstChild.childNodes ;
      this.thumbHolder = _root.thumbnails.createEmptyMovieClip("thumbnail"+ i, i);
      this.thumbHolder._x = i*spacing;
      this.thumbHolder.title = this.picHolder.attributes.title;
      this.thumbHolder.main = this.picHolder.attributes.main;

      this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage"+i, i);
      this.thumbLoader.loadMovie(picHolder.attributes.th mb);
      //create new movie and then load the thumbnails into it.

      thumbHolder.onRelease = function() {
      title_txt.text = this.title;