# Scroll bar isues

**URL:** <https://forum.kirupa.com/t/scroll-bar-isues/188100>\
**Category:** flash\
**Created:** [May 4, 2006, 3:04pm UTC](https://forum.kirupa.com/t/scroll-bar-isues/188100 "2006-05-04T15:04:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [May 4, 2006, 3:04pm UTC](https://forum.kirupa.com/t/scroll-bar-isues/188100/1 "2006-05-04T15:04:16Z")

</div>

Hey guys,  
Im recycling some script I used for a scroll bar a while back…minimal but ideal for my needs.

But I just cant get it to work in flash eight…here’s my AS

```
 ActionScript Code:
 [FONT=Courier New][LEFT]thumb_mc.[COLOR=#0000ff]onPress[/COLOR] = [COLOR=#000000] **function** [/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]

```

[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]gotoAndPlay[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#808080]_//find the usable length of travel, which is the height of the track minus the height of the thumb_[/COLOR]  
[COLOR=#000000] **var** [/COLOR] travelLength = track\_mc.[COLOR=#0000ff]\_height[/COLOR] - [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]\_height[/COLOR];  
[COLOR=#808080]_//make clip draggable_[/COLOR]  
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]startDrag[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000] **false** [/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], travelLength[COLOR=#000000])[/COLOR];  
[COLOR=#808080]_//scroll text in proportion to thumb position_[/COLOR]  
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onMouseMove[/COLOR] = [COLOR=#000000] **function** [/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#808080]_//find the fraction of thumb’s current position to its total travel length_[/COLOR]  
[COLOR=#000000] **var** [/COLOR] whereIsThumb = [COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]\_y[/COLOR] / travelLength[COLOR=#000000])[/COLOR];  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#808080]_//multiply text field’s maxscroll by this fraction_[/COLOR]  
[COLOR=#0000ff]\_parent[/COLOR].[COLOR=#000080]newsContent[/COLOR].[COLOR=#0000ff]scroll[/COLOR] = [COLOR=#000000]([/COLOR][COLOR=#0000ff]\_parent[/COLOR].[COLOR=#000080]newsContent[/COLOR].[COLOR=#0000ff]maxscroll[/COLOR] + [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR] \* whereIsThumb;  
[COLOR=#808080]_//make this behavior independent of movie’s frame rate_[/COLOR]  
[COLOR=#0000ff]updateAfterEvent[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR];  
[COLOR=#000000]}[/COLOR];

[COLOR=#808080]_//clear the enterFrame and restore usingThumb variable_[/COLOR]  
thumb\_mc.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#808080]_//go to “off” frame_[/COLOR]  
[COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000ff]stopDrag[/COLOR] COLOR=#000000[/COLOR];  
[COLOR=#0000ff]delete[/COLOR] [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onMouseMove[/COLOR];  
[COLOR=#000000]}[/COLOR];  
[/LEFT]  
[/FONT]

Source: [http://www.nineironmusic.co.uk/test.zip](http://www.nineironmusic.co.uk/test.zip)

Any help much appreciated!
