# SCROLLERS : same script trouble

**URL:** https://forum.kirupa.com/t/scrollers-same-script-trouble/119142
**Category:** Uncategorized
**Created:** [August 11, 2004, 9:19pm UTC](https://forum.kirupa.com/t/scrollers-same-script-trouble/119142 "2004-08-11T21:19:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fedeben](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@fedeben](https://forum.kirupa.com/u/fedeben)
#### Post date: [August 11, 2004, 9:19pm UTC](https://forum.kirupa.com/t/scrollers-same-script-trouble/119142/1 "2004-08-11T21:19:59Z")

</div>

Hello, anybody can help me ?  
I cant make work two scripts of that scroll at the same time, even if i change variables…

Any idea would be appreciated…

Thank u.

bar.useHandCursor = dragger.useHandCursor=false;  
space = 20;  
friction = 0.9;  
speed = 4;  
y = dragger.\_y;  
top = content.\_y;  
bottom = content.\_y+mask\_mc.\_height-content.\_height-space;  
dragger.onPress = function() {  
drag = true;  
this.startDrag(false, this.\_x, this.\_parent.y, this.\_x, this.\_parent.y+this.\_parent.bar.\_height-this.\_height);  
dragger.scrollEase();  
};  
dragger.onMouseUp = function() {  
this.stopDrag();  
drag = false;  
};  
bar.onPress = function() {  
drag = true;  
if (this.\_parent.\_ymouse\>this.\_y+this.\_height-this.\_parent.dragger.\_height) {  
this.\_parent.dragger.\_y = this.\_parent.\_ymouse;  
this.\_parent.dragger.\_y = this.\_y+this.\_height-this.\_parent.dragger.\_height;  
} else {  
this.\_parent.dragger.\_y = this.\_parent.\_ymouse;  
}  
dragger.scrollEase();  
};  
bar.onMouseUp = function() {  
drag = false;  
};  
moveDragger = function (d) { if ((dragger.\_y\>=y+bar.\_height-dragger.\_height && d == 1) || (dragger.\_y\<=y && d == -1)) {clearInterval(myInterval);} else {dragger.\_y += d;dragger.scrollEase();updateAfterEvent();}};  
up\_btn.onPress = function() {  
myInterval = setInterval(moveDragger, 18, -1);  
};  
down\_btn.onPress = function() {  
myInterval = setInterval(moveDragger, 18, 1);  
};  
up\_btn.onMouseUp = down\_btn.onMouseUp=function () { clearInterval(myInterval);};  
MovieClip.prototype.scrollEase = function() {  
this.onEnterFrame = function() {  
if (Math.abs(dy) == 0 && drag == false) {  
delete this.onEnterFrame;  
}  
r = (this.\_y-y)/(bar.\_height-this.\_height);  
dy = Math.round((((top-(top-bottom)\*r)-content.\_y)/speed)\*friction);  
content.\_y += dy;  
};  
};  
stop();
