# Scroler problem

**URL:** https://forum.kirupa.com/t/scroler-problem/7927
**Category:** flash
**Created:** [November 10, 2002, 4:09pm UTC](https://forum.kirupa.com/t/scroler-problem/7927 "2002-11-10T16:09:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![onno](https://avatars.discourse-cdn.com/v4/letter/o/dec6dc/32.png) [@onno](https://forum.kirupa.com/u/onno)
#### Post date: [November 10, 2002, 4:09pm UTC](https://forum.kirupa.com/t/scroler-problem/7927/1 "2002-11-10T16:09:46Z")

</div>

I did a slider, but it doesnt work fine, does anybody can tell me why?

this is the code i use

for up slider:

* * *

on (rollOver) {  
if (\_level0.instance1.slider.\_currentframe \>= 12) {  
\_level0.instance1.slider.stop();  
}  
else {  
\_level0.instance1.slider.play();  
}  
}  
on (rollOut) {  
\_level0.instance1.slider.stop();

}

* * *

for down slider:

* * *

on (rollOver) {  
if (\_level0.instance1.slider.\_currentframe \< 12) {  
\_level0.instance1.slider.gotoAndPlay(23 - \_currentframe);  
} else {  
\_level0.instance1.slider.play();  
}  
}  
on (rollOut) {  
\_level0.instance1.slider.stop();

}

* * *

i attached the FLA file to let you know what i did

thanks :cowboy:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 10, 2002, 5:02pm UTC](https://forum.kirupa.com/t/scroler-problem/7927/2 "2002-11-10T17:02:12Z")

</div>

hmmm…i think your going about it the wrong way. i think i would be much simpler and easier to just have an mc of  
whatever you want to scroll and just use something like this:  
\<hr\>  
on(rollOver) {  
while (\_root.distance \< \_root.max) {  
\_root.someMC.\_y += 2;  
\_root.distance +=2;

}  
}

and for the down:

on(rollOver) {  
while (\_root.distance \> 0) {  
\_root.someMC.\_y =- 2;  
\_root.distance =- 2;  
}  
}  
\<hr\>

and then in the first frame put:  
\<hr\>  
\_root.distance = 0;  
\_root.max = the lentgh of whatever you want to scroll;  
\<hr\>

i’m not real confident in my coding and i’m sure there’s a better way to do it, but that’s what i came up with. if it works awesome, if it doesn’t sorry.
