reverse the order of your xml??
hi y'all

i tried to subscribe to the flash forums on kirupia and on actionscript.org, but for some reason i never receive the confirmation emails. i'm at my wit's end with this problem and i need help!!!

there is an xml gallery w/thumbnail tutorial on kirupia which i followed and altered. i want to have variable thumbnail sizes and have them appear 1 pixel apart from each other instead of relying on all thumbs being equal widths, as in their gallery. i came up with a solution, but for some reason flash does things in reverse order (?!? why?) so it lists my thumbs in reverse order from the way they are supposed to be.

i'm kind of a noob, so there is probably a really simple solution i'm overlooking. i was thinking: how would one reverse the order in which flash is processing/placing the thumbs? or maybe instead of using my script, there's some kind of for loop that might work? any help is truly appreciated!

link to rough example: http://www.andreahendel.com/maxgallery/portraits.swf

here's the whole gallery code, the problem bit is towards the end:

////  import xml data and create arrays
function loadXML(loaded) {
  if (loaded) {
      xmlNode = this.firstChild;
      image = [];
      thumbnails = [];
      total = xmlNode.childNodes.length;
      for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; thumbnails[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
          thumbnails_fn(i);
      }
      firstImage();
  } else {
      content = "file not loaded!";
  }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("portraits.xml");
//// left and right key listener for large images
keylisten = new Object();
keylisten.onKeyDown = function() {
  if (Key.getCode() == Key.LEFT) {
      prevImage();
  } else if (Key.getCode() == Key.RIGHT) {
      nextImage();
  }
};
Key.addListener(keylisten);
////preloader
p = 0;
this.onEnterFrame = function() {
  filesize = picture.getBytesTotal();
  loaded = picture.getBytesLoaded();
  preloader._visible = true;
  if (loaded != filesize) {
      preloader.preload_bar._xscale = 100*loaded/filesize;
  } else {
      preloader._visible = false;
      if (picture._alpha<100) {
          picture._alpha += 10;
      }
  }
};
//// next image and previous image
function nextImage() {
  if (p<(total-1)) {
      p++;
      if (loaded == filesize) {
          picture._alpha = 0;
          picture.loadMovie(image[p], 1);
          picture_num();
      }
  }
}
function prevImage() {
  if (p>0) {
      p--;
      picture._alpha = 0;
      picture.loadMovie(image[p], 1);
      desc_txt.text = description[p];
      picture_num();
  }
}
function firstImage() {
  if (loaded == filesize) {
      picture._alpha = 0;
      picture.loadMovie(image[0], 1);
      picture_num();
  }
}
////thumbnail scroller
function thumbNailScroller() {
  this.createEmptyMovieClip("tscroller", 1000);
  scroll_speed = 10;
  tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) { if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
              thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
              thumbnail_mc._x += scroll_speed;
          }
      } else {
          delete tscroller.onEnterFrame;
      }
  };
}
//// thumbnail strip HERE IS WHERE MY TROUBLES ARE
w = 0
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
  tlistener = new Object();
  tlistener.onLoadInit = function(target_mc) {
      /// place thumbs HOW DO I MAKE THEM NOT LIST BACKWARDS
      target_mc._x = w
      w = target_mc._x + target_mc._width + 1
      /// make thumbs functional
      target_mc.pictureValue = k;
      target_mc.onRelease = function() {
          p = this.pictureValue-1;
          nextImage();
      };
      target_mc.onRollOver = function() {
          this._alpha = 50;
          thumbNailScroller();
      };
      target_mc.onRollOut = function() {
          this._alpha = 100;
      };
  };
  image_mcl = new MovieClipLoader();
  image_mcl.addListener(tlistener);
  image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

stop();


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to