Hey folks,
I am attempting to modify the code from the tutorial from this site for scrolling thumbnails in a photo gallery found here. In the tutorial it shows how to make the thumbnails scroll on a horizontal axis. I am trying to replicate this but with a vertical axis, but it doesn’t seem to be working. Can anyone tell me if it’s something wrong with my code?
Here is my code modified from the tutorials.
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
if ((_root._ymouse>=(hit_down._y-40)) && (thumbnail_mc.hitTest(hit_down))) {
thumbnail_mc._y -= scroll_speed;
} else if ((_root._ymouse<=(hit_up._y+40)) && (thumbnail_mc.hitTest(hit_up))) {
thumbnail_mc._y += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._y = hit_up._y+(target_mc._height+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
Here’s how it looks, the thumnails load in this position, but there are 5 more thumbnails over it that won’t scroll down. I have unhid the bars at the top and bottom to show the two spots the images are meant to go between, which are called hit_up and hit_down. you can click the few thumbnails that are visible but they will not scroll up nor down.