# FMX - adding table of contents to claudio's scroller

**URL:** <https://forum.kirupa.com/t/fmx-adding-table-of-contents-to-claudios-scroller/63128>\
**Category:** flash\
**Created:** [September 3, 2004, 3:19am UTC](https://forum.kirupa.com/t/fmx-adding-table-of-contents-to-claudios-scroller/63128 "2004-09-03T03:19:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_ew](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dr\_ew](https://forum.kirupa.com/u/dr_ew)\
**Post date:** [September 3, 2004, 3:19am UTC](https://forum.kirupa.com/t/fmx-adding-table-of-contents-to-claudios-scroller/63128/1 "2004-09-03T03:19:36Z")

</div>

Hi,  
I am using Claudio’s scroller to display a very long list of text. I am trying to add a set of buttons that would jump to specific headings in the text - sort of like anchors in html - but I’m not really sure how to go about doing this while keeping the scroller’s functionality intact.  
Any ideas for me?  
Here is the AS from the scroller:  
[AS]  
bar.useHandCursor = dragger.useHandCursor=false;  
space = 20;  
friction = 0.9;  
speed = 4;  
y = dragger.\_y;  
top = main.\_y;  
bottom = main.\_y+mask\_mc.\_height-main.\_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)-main.\_y)/speed)\*friction);  
main.\_y += dy;  
};  
};  
[/AS]  
I know that the content clip (main) position is dependent on the \_y of dragger, but when i set up buttons to alter the \_y of dragger directly, it messes up the scroller.  
Thanks =]
