Image gallery

i’m making a simple imageviewer but have stumbled across a problem i cant solve. the ac 2.0 code for it is the following.

It’s pretty nice, has zoom in and out functions for the external images loaded. Now my problem are the boundaries. The picture loaded in the imageholder goes over the frame when zooming. tried masking didnt work. I send the fla file as well. PLEASE HELP

_root.createEmptyMovieClip(“mcImageHolder”, 0);
var allPhotos:XMLNode = new XMLNode();
var currentPhoto:XMLNode = new XMLNode();
var photosXML:XML = new XML();
photosXML.ignoreWhite = true;
//don’t look at empty space in the XML file
photosXML.onLoad = function(ok:Boolean) {
if (ok == true) {
allPhotos = photosXML.firstChild;
currentPhoto = allPhotos.firstChild;
displayPhoto(currentPhoto);
} else {
txtCaption.text = “Error loading XML.”;
}
};
_root.onEnterFrame = function(){
trace("Loaded: w: "+mcImageHolder._width);
centerX = 289;
centerY = 320;
mcImageHolder._x = centerX-(mcImageHolder._width/2);
mcImageHolder._y = centerY-(mcImageHolder._height/2);
}
photosXML.load(“photos.xml”);
displayPhoto = function (photoData:XMLNode) {
// display caption
var captionNode:XMLNode = new XMLNode();
var captionTextNode:XMLNode = new XMLNode();
captionNode = photoData.firstChild;
captionTextNode = captionNode.firstChild;
txtCaption.text = captionTextNode.nodeValue;
// display image
var imageNode:XMLNode = new XMLNode();
var imageTextNode:XMLNode = new XMLNode();
imageNode = captionNode.nextSibling;
imageTextNode = imageNode.firstChild;
mcImageHolder.loadMovie(imageTextNode.nodeValue);
};
btnForward.onRelease = function() {
if (currentPhoto.nextSibling != null) {
currentPhoto = currentPhoto.nextSibling;
displayPhoto(currentPhoto);
}
};
btnBack.onRelease = function() {
if (currentPhoto.previousSibling != null) {
currentPhoto = currentPhoto.previousSibling;
displayPhoto(currentPhoto);
}
};