Next/Prev XML not working for image gallery

Hi there…

doing a website for a photographer, the next/prev buttons don’t seem to be working. I use the same xml techniques & code for next/prev i usually use… Tho it doesnt seem to be working at all… heres the code… Code is below… any help would be REALLY appreciated! :slight_smile:

import mx.transitions.*;
import mx.transitions.easing.*;

var xmlPhotosengland:XML = new XML();
var initThumb:Object = new Object();
var nextX = 0;
var totalthumbs1:Number;

xmlPhotosengland.onLoad = function() {
	totalthumbs1 = xmlPhotosengland.firstChild.childNodes.length;
	for (var i:Number = 0; i<xmlPhotosengland.firstChild.childNodes.length; i++) {
		initThumb.photo = (xmlPhotosengland.firstChild.childNodes*.attributes.photo);
		initThumb.ID = i+1;
		makeAThumb(i);
		nextX += 50;
	}
	setInterval(_root.england,"scroller",50);
};


initThumb.onRollOver = function() {
	thumbFade = new Tween(this, "_alpha", Strong.easeOut, 50, 100, .2, true);
};
initThumb.onRollOut = function() {
	thumbFadeBack = new Tween(this, "_alpha", Strong.easeOut, 100, 50, .2, true);
};
initThumb.onRelease = function() {
	p = this.ID;
	_root.empty.emptyBig.loadMovie("Images/England/"+this.photo+".jpg");
};


function makeAThumb(num) {
	thumbName = "mcThumb"+num;
	englandScroller.attachMovie("thumb",thumbName,num,initThumb);
	englandScroller[thumbName].mcPhoto.loadMovie("Images/England/thumbs/"+englandScroller[thumbName].photo+".jpg");
	englandScroller[thumbName]._x = nextX;
	englandScroller[thumbName]._y = -30;
	englandScroller[thumbName]._alpha = 50;
}

function scrollerKill() {
	scroller = null;
	englandScroller._x = 0;
}
function scroller() {
	if (this._ymouse>-80) {
		var scrollSpeed = (this._xmouse-Stage.width/2)/50;
		if (Math.abs(scrollSpeed)<1) {
			scrollSpeed = 0;
		}
		usaScroller._x -= scrollSpeed;
		if (englandScroller._x>0) {
			englandScroller._x = 0;
		} else if (englandScroller._x<Stage.width-englandScroller._width) {
			englandScroller._x = Stage.width-englandScroller._width;
		}
		if (englandScroller._width<Stage.width) {
			scrollerKill();
		}
	}
}

xmlPhotosengland.ignoreWhite = true;
xmlPhotosengland.load("photosengland.xml");
this.createEmptyMovieClip("englandScroller",this.getNextHighestDepth());
mcThumb1._x = 0;
mcThumb1._y = -30;

var p:Number = 1;
var picpath:String;
var thisgalthumbs:Number;

function nextImage() {
    if(p < thisgalthumbs){
        ++p;
        if(p < 10){ 
            empty.emptyBig.loadMovie("Images/England/"+"00"+p+".jpg");
        }else{
            empty.emptyBig.loadMovie("Images/England/"+"0"+p+".jpg");
        }
    }else{
        p = 0;
        nextImage();
    }
};

_root.next_btn.onRelease = function() {
        thisgalthumbs = totalthumbs1;
		trace("next")
        nextImage();
};

function prevImage() {
    if(p > 1){
        --p;
        if(p < 10){ 
            empty.emptyBig.loadMovie("Images/England/"+"00"+p+".jpg");
        }else{
            empty.emptyBig.loadMovie("Images/England/"+"0"+p+".jpg");
        }
    }else{
        p = thisgalthumbs+1;
        prevImage();
    }
};

_root.prev_btn.onRelease = function() {
        thisgalthumbs = totalthumbs1;
		trace("prev")
        prevImage();
};