# Custom scrollbar

**URL:** <https://forum.kirupa.com/t/custom-scrollbar/237605>\
**Category:** Uncategorized\
**Created:** [August 31, 2007, 9:16pm UTC](https://forum.kirupa.com/t/custom-scrollbar/237605 "2007-08-31T21:16:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aohk666](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@aohk666](https://forum.kirupa.com/u/aohk666)\
**Post date:** [August 31, 2007, 9:16pm UTC](https://forum.kirupa.com/t/custom-scrollbar/237605/1 "2007-08-31T21:16:10Z")

</div>

so i have made a few horizontal custom slider bars quite easily. by making 2 movie clips. setting the “bar’s” x and y values as the bounds and everything works great. but for some reason i can’t get it to work vertically. i use the same code and even try switching the x and y values…but nothing. the scroller movie clip jumps all over the screen and can barely move. my code is below. thanks for any help.

```auto
var sliderbounds:Rectangle = new Rectangle(scrollTrackMC.y, scrollTrackMC.x, scrollTrackMC.width, 12);

sliderMC.addEventListener(MouseEvent.MOUSE_DOWN, startdrag)
sliderMC.addEventListener(MouseEvent.MOUSE_UP, stopdrag)

function startdrag(myevent:MouseEvent):void{
	myevent.target.startDrag(false, sliderbounds);
}
function stopdrag(myevent:MouseEvent):void{
	myevent.target.stopDrag();
}

```
