Resizing slideshow with voiceovers

I’m really bad at this ActionScript stuff, and so sort of at the end of the proverbial rope here.

I’ve modded an early version of the infamous resizing slideshow script to pull sound clips from the XML file, and automatically advance to the next photo after the sound clip finishes.

But if you just let the slideshow run by itself, it doesn’t perform the resizing border trick right. It gets hung on the size of the first picture, and from then on, it’s always one picture behind (unless you press the next or previous buttons at any point, in which case it corrects itself).

You can see my problem for yourself.

You can download a zip file that includes the FLA.

I’m pasting what I think is the relevant code below. Thank you so much for any help you can offer on this:

// Show the first slide and intialize variables
function startSlideShow(success) {
	if (success == true) {
		rootNode = slides_xml.firstChild;
		galName = rootNode.attributes.name;
		storylink = rootNode.attributes.url;
		firstSlideNode = rootNode.firstChild;
		currentSlideNode = firstSlideNode;
		currentIndex = 1;
		updateSlide(firstSlideNode);
	}
}
function moveOn() {
	noise = new Sound();
	noise.loadSound(soundPath, true);
	noise.onSoundComplete = function() {
		autoAdvance();
	};
}
// 
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
	imagePath = "images/"+newSlideNode.attributes.jpegURL+".jpg";
	soundPath = "clips/"+newSlideNode.attributes.jpegURL+".mp3";
	targetClip.loadPic(imagePath);
	moveOn();
	if (currentIndex == 1) {
		_root.prevBTN._visible = 0;
	} else if (currentIndex == totalSlides) {
		_root.nextBTN._visible = 0;
	} else {
		_root.prevBTN._visible = 1;
		_root.nextBTN._visible = 1;
	}
}
// 
// Adds automatic slideshow functionality
function autoAdvance() {
	nextSlideNode = currentSlideNode.nextSibling;
	if (nextSlideNode == null) {
		getURL(_root.storylink);
	} else {
		currentIndex++;
		currentSlideNode = nextSlideNode;
		updateSlide(nextSlideNode);
	}
}
// 
// Event handler for 'Next slide' button
nextBTN.onRelease = function() {
	if (go == true) {
		go = false;
		clearInterval(showOff);
		autoMC.gotoAndStop("up");
	}
	nextSlideNode = currentSlideNode.nextSibling;
	if (nextSlideNode == null) {
		break;
	} else {
		currentIndex++;
		updateSlide(nextSlideNode);
		currentSlideNode = nextSlideNode;
	}
};
// 
// Event handler for 'Previous slide' button
prevBTN.onRelease = function() {
	if (go == true) {
		go = false;
		clearInterval(showOff);
		autoMC.gotoAndStop("up");
	}
	previousSlideNode = currentSlideNode.previousSibling;
	if (previousSlideNode == null) {
		break;
	} else {
		currentIndex--;
		currentSlideNode = previousSlideNode;
		updateSlide(previousSlideNode);
	}
};

// load the picture into the container frame.
MovieClip.prototype.loadPic = function(pic) {
	_root.targetClip._alpha = 0;
	this.loadMovie(pic);
	_root.onEnterFrame = function() {
		var t = targetClip.getBytesTotal(), l = targetClip.getBytesLoaded();
		var sT = noise.getBytesTotal(), sL = noise.getBytesLoaded();
		var total = t+sT;
		var loaded = l+sL;
		var jpgStat = Math.floor((l/t)*100);
		_root.percentDone = jpgStat+"% loaded";
		if (t>500 && targetClip._width != 0) {
			if (Math.round(l/t) == 1) {
			var w = targetClip._width+spacing, h = targetClip._height+spacing;
				border.resizeMe(w, h);
				delete _root.onEnterFrame;
				_root.percentDone = "";
			}
		}
	};
};
MovieClip.prototype.resizeMe = function(w, h) {
	var speed = 3;
	this.onEnterFrame = function() {
		this._width += (w-this._width)/speed;
		this._height += (h-this._height)/speed;
		if (Math.abs(this._width-w)<1) {
			this._width = w;
			this._height = h;
			_root.targetClip._x = this._x-this._width/2+spacing/2;
			_root.targetClip._y = this._y-this._height/2+spacing/2;
			_root.targetClip._alpha += 10;
			if (_root.targetClip._alpha>90) {
				_root.targetClip._alpha = 100;
				delete this.onEnterFrame;
			}
		}
	};
};