# Photo Gallery "thumbnails" question

**URL:** https://forum.kirupa.com/t/photo-gallery-thumbnails-question/189390
**Category:** flash
**Created:** [June 2, 2006, 4:02am UTC](https://forum.kirupa.com/t/photo-gallery-thumbnails-question/189390 "2006-06-02T04:02:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coffeebot3000](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@coffeebot3000](https://forum.kirupa.com/u/coffeebot3000)
#### Post date: [June 2, 2006, 4:02am UTC](https://forum.kirupa.com/t/photo-gallery-thumbnails-question/189390/1 "2006-06-02T04:02:34Z")

</div>

First of all, this is a great site, and I’m really appreciative to everyone who is out there helping new users like myself.

As for my question, I used your “photo gallery with thumbnails” tutorial, and it came out great. What I wanted to know is if anyone knows how, instead of the thumbnails scrolling side to side based on mouse position, if I can get them to scroll left or right based on when someone pushes and holds down a left or right button. I’m sure it’s probably a very easy solution; I just can’t figure it out.

Thanks for your help!

\*\*The following is the bit of code I’m referring to, and want to change:  
[COLOR=Orange]  
[COLOR=Teal]// thumbnail code!  
this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 10;  
tscroller.onEnterFrame = function() {

if ((\_root.\_ymouse\>=thumbnail\_mc.\_y) && (\_root.\_ymouse\<=thumbnail\_mc.\_y+thumbnail\_mc.\_height)) {

if ((\_root.\_xmouse\>=(hit\_right.\_x-40)) && (thumbnail\_mc.hitTest(hit\_right))) {

thumbnail\_mc.\_x -= scroll\_speed;

} else if ((\_root.\_xmouse\<=(hit\_left.\_x+40)) && (thumbnail\_mc.hitTest(hit\_left))) {

thumbnail\_mc.\_x += scroll\_speed;

}

} else {

delete tscroller.onEnterFrame;

}

};[/COLOR][/COLOR]
