# Also need help with Simple Scroll Tutorial

**URL:** <https://forum.kirupa.com/t/also-need-help-with-simple-scroll-tutorial/183896>\
**Category:** flash\
**Created:** [March 31, 2006, 12:43am UTC](https://forum.kirupa.com/t/also-need-help-with-simple-scroll-tutorial/183896 "2006-03-31T00:43:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpdesign](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@bpdesign](https://forum.kirupa.com/u/bpdesign)\
**Post date:** [March 31, 2006, 12:43am UTC](https://forum.kirupa.com/t/also-need-help-with-simple-scroll-tutorial/183896/1 "2006-03-31T00:43:49Z")

</div>

I am trying to use the Simple Scroll bar code to do my own, however I want my scroller to be horizontal, instead of vertical. It is working however, the scrollFace that I’m using is going in the wrong direction, (the scrollFace should go to the right and it is going to the left, away from underneath the mask)

Here is my code…can someone tell me were I’m going wrong?

Thanks!

scrolling = function () {  
var scrollWidth:Number = scrollTrack.\_width;  
var contentWidth:Number = portfolioContent.\_width;  
var scrollFaceWidth:Number = scrollFace.\_width;  
var maskWidth:Number = maskedView.\_width;  
var initPosition:Number = scrollFace.\_x=scrollTrack.\_x;  
var initContentPos:Number = portfolioContent.\_x;  
var finalContentPos:Number = maskWidth-contentWidth+initContentPos;  
var left:Number = scrollTrack.\_x;  
var top:Number = scrollTrack.\_y;  
var right:Number = Width-scrollFaceHeight+scrollTrack.\_x;  
var bottom:Number = scrollTrack.\_y;  
var dy:Number = 0;  
var speed:Number = 10;  
var moveVal:Number = (contentWidth-maskWidth)/(scrollWidth-scrollFaceWidth);

scrollFace.onPress = function() {  
var currPos:Number = this.\_x;  
startDrag(this, false, left, top, right, bottom);  
this.onMouseMove = function() {  
dy = Math.abs(initPosition-this.\_x);  
portfolioContent.\_x = Math.round(dy\*-1\*moveVal+initContentPos);  
};  
};  
scrollFace.onMouseUp = function() {  
stopDrag();  
delete this.onMouseMove;  
};  
btnUp.onPress = function() {  
this.onEnterFrame = function() {  
if (portfolioContent.\_x=x+speed\<maskedView.\_x) {  
if (scrollFace.\_x\<=left) {  
scrollFace.\_x = left;  
} else {  
scrollFace.\_x -= speed/moveVal;  
}  
portfolioContent.\_x += speed;  
} else {  
scrollFace.\_x = right;  
portfolioContent.\_x = maskedView.\_x;  
delete this.onEnterFrame;  
}  
};  
};  
btnUp.onDragOut = function() {  
delete this.onEnterFrame;  
};  
btnUp.onMouseOut = function() {  
delete this.onEnterFrame;  
};  
btnDown.onPress = function() {  
this.onEnterFrame = function() {  
if (portfolioContent.\_x-speed\>finalContentPos) {  
if (scrollFace.\_x\>=right) {  
scrollFace.\_x = right;  
} else {  
scrollFace.\_x += speed/moveVal;  
}  
portfolioContent.\_x -= speed;  
} else {  
scrollFace.\_x = right;  
portfolioContent.\_x = finalContentPos;  
delete this.onEnterFrame;  
}  
};  
};  
btnDown.onRelease = function() {  
delete this.onEnterFrame;  
};  
btnDown.onDragOut = function() {  
delete this.onEnterFrame;  
};

if (contentWidth\<maskWidth) {  
scrollFace.\_visible = false;  
btnUp.enabled = false;  
btnDown.enabled = false;  
} else {  
scrollFace.\_visible = true;  
btnUp.enabled = true;  
btnDown.enabled = true;  
}  
};  
scrolling();

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [March 31, 2006, 1:14am UTC](https://forum.kirupa.com/t/also-need-help-with-simple-scroll-tutorial/183896/2 "2006-03-31T01:14:33Z")

</div>

can you attach / send us your fla?

---

<div class="post-metadata">

**Author:** ![bpdesign](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@bpdesign](https://forum.kirupa.com/u/bpdesign)\
**Post date:** [March 31, 2006, 3:02am UTC](https://forum.kirupa.com/t/also-need-help-with-simple-scroll-tutorial/183896/3 "2006-03-31T03:02:54Z")

</div>

Sorry… Didn’t realize that I could do that! Thanks for the help!
