# Custom ScrollBar

**URL:** <https://forum.kirupa.com/t/custom-scrollbar/276717>\
**Category:** flash\
**Created:** [December 2, 2008, 11:08pm UTC](https://forum.kirupa.com/t/custom-scrollbar/276717 "2008-12-02T23:08:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thew\_Technology](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Thew\_Technology](https://forum.kirupa.com/u/Thew_Technology)\
**Post date:** [December 2, 2008, 11:08pm UTC](https://forum.kirupa.com/t/custom-scrollbar/276717/1 "2008-12-02T23:08:54Z")

</div>

Hey! First Time on this forum, however I’ve used this site for reference many times, very helpful…Anyhoo, I’ve looked all over the internet for a simple scrollbar code but all that I found were countless post of long painful code…I was sure there had to be something more simple with the same effect and I’ll share what I came up with myself!

onEnterFrame = function(){  
position1 = scrollFace\_btn.\_y;  
book\_mc.\_y = -position1;  
scrollFace\_btn.onPress = function(){startDrag(scrollFace\_btn,true,831.0,39.0,831.0,361.3)}  
scrollFace\_btn.onRelease = function(){stopDrag();}  
scrollFace\_btn.onReleaseOutside = function(){stopDrag();}  
}  
Its really simple! position1 keeps record of the scrollFace  
book\_mc is what was being scrolled(object set to 0,0 in movieclip)  
So its as simple as subtracting scrollface.\_y(position1) from book\_mc!  
EASY!  
Has the same effect as all the other code found! :azn:
