Scroll Bar gone awry

I've got a scrolling text bar that I've used on several ocassions, but while I know THAT it works, I don't understand WHY it works. Consequently, when I introduce different dimensions of the track and the size of the track, I get what you see by going out to http://www.brucegust.com/Radio.html

The scroll button doesn't line up where it should and it travels beyond the track. I've included a link to the actual fla file. Any ninja out there who would be willing to show me where I need to make my changes will be honored with both points and praise.

Here's the zip file:

http://www.brucegust.com/Scrollbar.zip
brucegustPHP DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZefferCommented:
in the code on frame 1 make these 3 changes..

stop();
scrolling = function () {
var scrollHeight:Number = scrollTrack._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrack._y -33;   ////here
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y - 33; ////here
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y - 30; ////here
var dy:Number = 0;
var speed:Number = 10;
etc
etc

Z
0
ZefferCommented:
on reviewing that I see stopping the knob exactly against the bottom stop..same as the top..doesn't show the last line of text properly..so change the last line  where I made changes ..to..
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y - 25;
and move the stop down a little.

Z
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brucegustPHP DeveloperAuthor Commented:
Zeffer, you have the points, my friend. Two questions, if you could indludge me...

First of all, why do your suggestions work? I tried a number of different things, but the way you were able to hone in on what precisely would make the difference compels me to ask what it is that you saw that told you, "Here is where the changes need to be made..."

Secondly, the code is below. The text still isn't revealed in it's entirety. You mentioned moving the "stop down a little..." What is that and where does that change need to occur?

Thanks!

stop();
scrolling = function () {
var scrollHeight:Number = scrollTrack._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrack._y-33;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos//here's a change;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y-33;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y-30;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
0
ZefferCommented:
well we know the knob (instance name scrollFace)slides up and down on the y axis
it was starting off 1/4 of the way down the slide track..so we change the 'initial position' by minus 33 pixels (up)
var initPosition:Number = scrollFace._y=scrollTrack._y-33;

the knob was travelling past the buttom of the track..so we change the point where it stops by minus 30 pixels
we know it's here we make the change...
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y-30;
as it is preceded by the variables left, top, right.. (left,top,right.bottom)which define the position of the slider

and the final content position is a similar fix.

As dragging the knob or using the buttons are separate actions..it was not exactly right and I  lengthened the slide track a little and moved the bottom button down and made a couple of other mysterious changes (some numbers in the scrollface code) ;)

here it is all fixed..
http://www.redpearl.co.nz/ee/radio1.zip

Z
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.