Scroler problem

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:

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.