The age old horizontal scrolling question :)

hello all, got an xml file holding image urls and widths. the number of photos and width of photos can change. got them all loaded and spaced correctly based on the prev photos width and got them scrolling. so…my problem is that i can’t get them to loop so maybe i scripted it all incorrectly to begin with it…any ideas on looping?

loop script:

 
 
var nodes = jd.firstChild.childNodes;
var tot_pics:Number = nodes.length;
_global.tp = tot_pics;
var w:Number = 0;
var b:Number = 0;
var a:Number = 0;
 
  for(var i=0; i<tot_pics; i++)
  {
  var p = home.attachMovie("main", "main"+i,i);
  p.pic_holder.loadMovie(nodes*.childNodes[0].childNodes[0].nodeValue);
  p.onEnterFrame = mover;
 
  if(i==0)
  {
   var z:Number = 0; //sets first photo to 0 since there's no previous photo
   setProperty(p, _x, z);
  } 
  else 
  {
   var b:Number = Number(a) + Number(nodes[i-1].childNodes[1].childNodes[0].nodeValue);
   var c:Number = nodes*.childNodes[1].childNodes[0].nodeValue;
   w = Number(b);
   setProperty(p,_x,w);
   a = Number(w);
  }
 } // end for loop
 
 
function mover()
{
 var last_pic:String = "_level0.main"+(_global.tp-1);
 if(this == last_pic)
 { 
  this._x = this._x+10;
 } 
 else 
 {
  this._x = this._x-10;
 }
 trace(this._x);
}
 

in my mover() i tried grabbing the _x of the last pic and then sending all the photos back the other direction…that didn’t work either :wink: but i really want them to loop!
thanks!