Hi gurus,
Newbie here (the more you read, the more I will prove that!! LOL). I have been following through the “gallery” tutorials here on Kirupa, and finally got to the third version (the one with the auto-scrolling thumbnails along the bottom, which scroll left / right based on the mouse pointer position, and the keyboard Left / Right scrolling).
I need my thumbnails to scroll UP and DOWN instead of LEFT and RIGHT, and have been trying to modify the ActionScript that came with the downloadable .fla file for the tutorial, but without complete success yet. (The functionality of the whole thing is still intact except for the scrolling thumbnails.)
Here is the portion of the AS that addresses the thumbnail scroller, and I have highlighted in red the variables that I believe need to be swapped around for it to scroll vertically instead of horizontally. I have made the obvious changes such as :-
_width changed to _height
hit_left changed to hit_up
hit_right changed to hit_down
_x changed to _y
_y changed to _x
[SIZE=1]function thumbNailScroller() { [/SIZE]
[SIZE=1]// thumbnail code! [/SIZE]
[SIZE=1]this.createEmptyMovieClip(“tscroller”, 1000); [/SIZE]
[SIZE=1]scroll_speed = 10; [/SIZE]
[SIZE=1]tscroller.onEnterFrame = function() { [/SIZE]
[SIZE=1]if ((_root[COLOR=#ff0000]._ymouse[/COLOR]>=thumbnail_mc[COLOR=#ff0000]._y[/COLOR]) && (root.[COLOR=#ff0000]ymouse[/COLOR]<=thumbnail_mc[COLOR=#ff0000]._y[/COLOR]+thumbnail_mc[COLOR=#ff0000]._height[/COLOR])) { [/SIZE]
[SIZE=1]if ((_root[COLOR=#ff0000]._xmouse[/COLOR]>=(hit[COLOR=#ff0000]_right._x[/COLOR]-40)) && (thumbnail_mc.hitTest(hit[COLOR=#ff0000]_right[/COLOR]))) { [/SIZE]
[SIZE=1]thumbnail_mc[COLOR=#ff0000]._x [/COLOR]-= scroll_speed; [/SIZE]
[SIZE=1]} else if ((_root[COLOR=#ff0000]._xmouse[/COLOR]<=40) && (thumbnail_mc.hitTest(hit[COLOR=#ff0000]_left[/COLOR]))) { [/SIZE]
[SIZE=1]thumbnail_mc[COLOR=#ff0000]._x [/COLOR]+= scroll_speed; [/SIZE]
[SIZE=1]} [/SIZE]
[SIZE=1]} else { [/SIZE]
[SIZE=1]delete tscroller.onEnterFrame; [/SIZE]
[SIZE=1]} [/SIZE]
[SIZE=1]}; [/SIZE]
[SIZE=1]} [/SIZE]
[SIZE=1]function thumbnails_fn(k) { [/SIZE]
[SIZE=1]thumbnail_mc.createEmptyMovieClip(“t”+k, thumbnail_mc.getNextHighestDepth()); [/SIZE]
[SIZE=1]tlistener = new Object(); [/SIZE]
[SIZE=1]tlistener.onLoadInit = function(target_mc) { [/SIZE]
[SIZE=1]target_mc[COLOR=#ff0000]._x [/COLOR]= hit[COLOR=#ff0000]_left._x[/COLOR]+(eval(“thumbnail_mc.t”+k[COLOR=#ff0000])._width[/COLOR]+5)*k; [/SIZE]
[SIZE=1]target_mc.pictureValue = k; [/SIZE]
[SIZE=1]target_mc.onRelease = function() { [/SIZE]
[SIZE=1]p = this.pictureValue-1; [/SIZE]
[SIZE=1]nextImage(); [/SIZE]
[SIZE=1]}; [/SIZE]
[SIZE=1]target_mc.onRollOver = function() { [/SIZE]
[SIZE=1]this._alpha = 50; [/SIZE]
[SIZE=1]thumbNailScroller(); [/SIZE]
[SIZE=1]}; [/SIZE]
[SIZE=1]target_mc.onRollOut = function() { [/SIZE]
[SIZE=1]this._alpha = 100; [/SIZE]
[SIZE=1]}; [/SIZE]
[SIZE=1]}; [/SIZE]
[SIZE=1]image_mcl = new MovieClipLoader(); [/SIZE]
[SIZE=1]image_mcl.addListener(tlistener); [/SIZE]
[SIZE=1]image_mcl.loadClip(thumbnails[k], “thumbnail_mc.t”+k); [/SIZE]
[SIZE=1]} [/SIZE]
Again, this is the ORIGINAL ActionScript, not my modified version. Only the items highlighted in red have been changed in my modified version. Basically when I test the movie now, I get the last two thumbnails of the gallery transposed one over the other, at the point of the movie clip instance, and no scrolling at all. When I use the UP and DOWN keys, I do get to “manually” scroll through the big images, but no change in the thumbnail area.
What have I screwed up or overlooked? I have scanned and scanned and scanned the above section of the AS, and I can’t see any other variables that ought to be meddled with. HELP???!! :h:
Thx all, cheers,
Mike W.