# Scrolling Thumbnails w/ Mouse Control Problem!

**URL:** https://forum.kirupa.com/t/scrolling-thumbnails-w-mouse-control-problem/262312
**Category:** flash
**Created:** [June 4, 2008, 11:28pm UTC](https://forum.kirupa.com/t/scrolling-thumbnails-w-mouse-control-problem/262312 "2008-06-04T23:28:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bifhead](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bifhead](https://forum.kirupa.com/u/bifhead)
#### Post date: [June 4, 2008, 11:28pm UTC](https://forum.kirupa.com/t/scrolling-thumbnails-w-mouse-control-problem/262312/1 "2008-06-04T23:28:42Z")

</div>

Hey peeps, bare with me im not great at actionscript ok. The thumbs scroll fine but they scroll way too fast! which makes them difficult to click on. Heres the code im using and i hope ye can help. Thanks in advance.

\_root.onEnterFrame = function(){

```
if(_root._ymouse&lt;210){
    myVar=false;}{
    if(_root._ymouse&gt;209)
    myVar=true;
    }
if(_root._xmouse&lt;350 and myVar==true){
    imgBar.prevFrame();
    imgBar.prevFrame();
    
    
}
else{
        imgBar.play();
    }

if(_root._xmouse&gt;550 and myVar==true){
    imgBar.nextFrame();
    
}
else{
        imgBar.play();
    }

```

}

---

<div class="post-metadata">

### Author: ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)
#### Post date: [June 5, 2008, 9:44am UTC](https://forum.kirupa.com/t/scrolling-thumbnails-w-mouse-control-problem/262312/2 "2008-06-05T09:44:52Z")

</div>

yup there is not much code but if it is on enterframe it would be crazy fast

---

<div class="post-metadata">

### Author: ![bifhead](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bifhead](https://forum.kirupa.com/u/bifhead)
#### Post date: [June 5, 2008, 12:32pm UTC](https://forum.kirupa.com/t/scrolling-thumbnails-w-mouse-control-problem/262312/3 "2008-06-05T12:32:15Z")

</div>

[quote=fasilak;2337005]In your code… you have called prevFrame() two times

To further achieve ur functionality why dont you try using the setInterval instead of onEnterFrame.

For more details on setInterval visit:  
[http://www.oman3d.com/tutorials/flash/setinterval/](http://www.oman3d.com/tutorials/flash/setinterval/)

If somehow you want this code…  
add a counter…  
Check the code below:

```auto

var counter:Number = 0;
var wait_count:Number = 50;
_root.onEnterFrame = function() {
 if (counter != wait_count) {
  counter++;
  return;
 } else {
  counter = 0;
 }
 if (_root._ymouse<210) {
  myVar = false;
 }
 if (_root._ymouse>209) {
  myVar = true;
 }
 if (_root._xmouse<350 and myVar == true) {
  imgBar.prevFrame();
  imgBar.prevFrame();
 } else {
  imgBar.play();
 }
 if (_root._xmouse>550 and myVar == true) {
  imgBar.nextFrame();
 } else {
  imgBar.play();
 }
};
 

```

Note: this is not the right way to do it… The best method i would prefer is the setInterval.[/quote]

Thanks very much fasilak for your help. I tried the code you wrote but when i use it theres no mouse control, the thumbs scroll and stop now and then. I guess il have to try and figure out the setInterval method.
