Image rotation with xml

I building a photo gallery using xml, I want to have my photo go thru a rotation after the xml is loaded. I would post the fla but its 94kb which is to big. So I’ll post my code and do my best to explain what going on. My xml loading code looks like this:


photo_filename = new Array();
photo_thumbnail = new Array();
photo_description = new Array();
photo_header = new Array();
photo_link = new Array();
photo_gallery = new Array();
filepath = "photos/";
// Load the photos XML
var libertyFC_xml = new XML();
libertyFC_xml.ignoreWhite = true;
libertyFC_xml.onLoad = function()
{
 var nodes:Array = this.firstChild.childNodes;
 for(var i=0;i<nodes.length;i++)
 {
  photo_filename.push(nodes*.attributes.filename);
  photo_thumbnail.push(nodes*.attributes.thumbnail);
  photo_description.push(nodes*.attributes.description);
 
  photo_header.push(nodes*.attributes.header);  
  photo_link.push(nodes*.attributes.storylink);  
  photo_gallery.push(nodes*.attributes.gallerylink);   
 }
 
}
//libertyFC_xml.load(filepath + "vh_photos.xml");
libertyFC_xml.load("vh_photos.xml");

After this is loaded it goes to a frame and loads up my thumbnails:


y_middle = Stage.height/2;
tn_group.tn._visible = false;
tn_group.setMask( tn_area );
tn_alpha_default = 100;
p = 0;
for( var i = 0; i < photo_thumbnail.length; i++ )
{
 tn_group.tn.duplicateMovieClip("tn"+i, i);
 
 tn_group["tn"+i].tn_pic.loadMovie( filepath +photo_thumbnail* );
 tn_group["tn"+i]._x = tn._x;
 //original fla photos were 100x90
 //tn_group["tn"+i]._y = i * 100;
 //set spacing : new photos will be 85x51
 tn_group["tn"+i]._y = i * 60;
 tn_group["tn"+i].tn_pic._alpha = tn_alpha_default;
 tn_group["tn"+i].tn_no = i;
 
 
 tn_group["tn"+i].tn_button.onRollOver = function() 
 {
  this._parent.tn_pic._alpha = 100;
 }
 tn_group["tn"+i].tn_button.onRollOut = function() 
 {
  this._parent.tn_pic._alpha = tn_alpha_default;
 }
 tn_group["tn"+i].tn_button.onRelease = function() 
 {
  _root.p = this._parent.tn_no;
  _root.play();
 }
 /**/
}

When I click on one of the thumbnails it moves to a frame and loads the large pic


pic.loadMovie(filepath + photo_filename[p]);
desc = photo_description[p];
hedr = photo_header[p];
output = photo_link[p];
gallery = photo_gallery[p];
old_p = p;

My questions is first, where would I put my rotation function on the frame where i actually load the large photo and two, how would I write the rotation function. I am not interested in a random rotation but a ordered rotation.

You can visit my development site http://dev-libertyfc.virtualhorizons.com/
I need the four soccer images the large ones to rotate one after the other just like it does on this site:http://www.chelseafc.com/page/Home/0,,10268,00.html

here is my rotation code which isn’t working; it gives me an error :
Error opening URL ‘file:///D|/DONS%5FINTERNET%5FPROJECTS/Liberty%20FC%5F2008/photos/undefined’


nextImage();
//start rotation of images
function nextImage() {
 _root.p = this._parent.tn_no;
 if (p<(total-1)) {
  p++;
  //if (loaded == filesize) {
   pic._alpha = 0;
   pic.loadMovie(filepath+photo_filename[p]);   
   //desc = photo_description[p];
   //hedr = photo_header[p];
   //output = photo_link[p];
   //gallery = photo_gallery[p];
   pic_num();
  //}
 }
}

Any help appreciated.