# 2 Scroll Bars on one page- PROBLEM! HELP!

**URL:** https://forum.kirupa.com/t/2-scroll-bars-on-one-page-problem-help/241603
**Category:** Uncategorized
**Created:** [October 16, 2007, 2:15am UTC](https://forum.kirupa.com/t/2-scroll-bars-on-one-page-problem-help/241603 "2007-10-16T02:15:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![derektoews](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@derektoews](https://forum.kirupa.com/u/derektoews)
#### Post date: [October 16, 2007, 2:15am UTC](https://forum.kirupa.com/t/2-scroll-bars-on-one-page-problem-help/241603/1 "2007-10-16T02:15:22Z")

</div>

so i have 2 scroll bars on one page.  
the first scroll bar scrolls, but text doesn’t.  
I have checked the code like 5 times to make sure i have the text named right and stuff…  
but the second scroll bar and text works perfect.  
and when I take the actionscript out for the second scroll bar, the first works perfectly.  
don’t understand.  
please help!!  
here’s my code:  
var scroll1Upper:Number = 308;  
var scroll1Lower:Number = 475;

var textLower:Number =310;  
var textUpper:Number =192;

var scroll1Range:Number = scroll1Lower - scroll1Upper;  
var textRange:Number = textLower - textUpper;

function scroll() {  
var moved:Number = sb1\_mc.\_y - scroll1Upper;  
var pctMoved:Number = moved/scroll1Range;  
var textMove:Number = pctMoved\*textRange;  
text1\_mc.\_y = textLower - textMove;  
}

sb1\_mc.onPress = function() {  
this.startDrag(false,this.\_x,scroll1Upper,this.\_x,scroll1Lower);  
this.onMouseMove = scroll;  
}

sb1\_mc.onRelease = sb1\_mc.onReleaseOutside = function() {  
this.stopDrag();  
this.onMouseMove = null;  
}

thumb1\_btn.onRelease = function() {  
gotoAndPlay(“large1”);  
}

thumb2\_btn.onRelease = function() {  
gotoAndPlay(“large2”);  
}

thumb3\_btn.onRelease = function() {  
gotoAndPlay(“large3”);  
}

thumb4\_btn.onRelease = function() {  
gotoAndPlay(“large4”);  
}

coffee\_btn.onRelease = function() {  
gotoAndPlay(“coffee”);  
}

artist\_btn.onRelease = function() {  
gotoAndPlay(“artist”);  
}

pipe\_btn.onRelease = function() {  
gotoAndPlay(“pipe”);  
}

about\_btn.onRelease = function() {  
gotoAndPlay(“about”);  
}

army\_btn.onRelease = function() {  
gotoAndPlay(“army”);  
}

contact\_btn.onRelease = function() {  
getURL("mailto:derektoews@gmail.com");  
}

jenn\_btn.onRelease = function() {  
gotoAndPlay(“jenn”);  
}

home\_btn.onRelease = function() {  
gotoAndPlay(“home”);  
}

var scrollUpper:Number = 610;  
var scrollLower:Number = 780;

var textLower:Number =610;  
var textUpper:Number =572;

var scrollRange:Number = scrollLower - scrollUpper;  
var textRange:Number = textLower - textUpper;

function scroll() {  
var moved:Number = sb2\_mc.\_y - scrollUpper;  
var pctMoved:Number = moved/scrollRange;  
var textMove:Number = pctMoved\*textRange;  
text2\_mc.\_y = textLower - textMove;  
}

sb2\_mc.onPress = function() {  
this.startDrag(false,this.\_x,scrollUpper,this.\_x,scrollLower);  
this.onMouseMove = scroll;  
}

sb2\_mc.onRelease = sb2\_mc.onReleaseOutside = function() {  
this.stopDrag();  
this.onMouseMove = null;  
}
