Hi,
I have a small scrolling image gallery I am creating. I have adapted the XML/Flash Photo Gallery w/ Thumbnails tutorial here to help me. Ive basically just created the thumbnail part and modified it. Instead of moving the images with a mouseover, I have it just set to display 12 images, and just display the next twelve by clicking the next button. I have created two little movie clips at the end of the scrolling area with the intention of using hitTest with the images to keep the user from scrolling indefinitely when there are no more pictures. However, I cant get this part to work right. Any guidance is appreciated!
For reference:
The 2 invisible boundary MC’s are called boundary_left and boundary_right
The next and back buttons are hit_left and hit_right (a little confusing I know)
and the image thumbnails are thumbnail_mc.
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
thumbnails* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+10)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
function hitChecker(){
this.createEmptyMovieClip("tchecker", 1000);
tchecker.onEnterFrame= function(){
if (thumbnail_mc, hitTest(boundary_left)){
hit_right.enabled="true";
}
else {
hit_left.enabled=false;
}
if (thumbnail_mc, hitTest(boundary_right)){
hit_right.enabled=true;
}
else {
hit_left.enabled=false;
}