Solved

Scroll Bar gone awry

Posted on 2007-03-29
4
166 Views
Last Modified: 2010-04-03
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
0
Comment
Question by:brucegust
  • 3
4 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 18821342
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
 
LVL 23

Accepted Solution

by:
Zeffer earned 500 total points
ID: 18821362
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
 

Author Comment

by:brucegust
ID: 18823144
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
 
LVL 23

Expert Comment

by:Zeffer
ID: 18826171
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

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question