Link to home
Start Free TrialLog in
Avatar of plundquist
plundquist

asked on

How to link a slider bar to content?

Hi! I am sure this is a super easy thing to do, but as I am clueless, I am needing help!
I am using Flash MX. I have created a slider with a line and dragger, I followed the tutorial from
http://www.kirupa.com/developer/mx/slider.htm
except mine is vertical instead of horizontal.

Here is the code I have in frame 1 of the movie clip that is my slider:

this.ratio=0 ;
dragger.onPress=function(){
      this.startDrag(true,0,0,0,((line._height)-120));
      this.onEnterFrame=function(){
            ratio=Math.round(this._y*100/line._height) ;
      }
}
dragger.onRelease=dragger.onreleaseOutside=stopDrag;

And here is the code I have in frame 1 of the movie it appears in:

this.onEnterFrame=function(){
   ratio.text=mySlider.ratio;
}

So, that works slick, EXCEPT for the fact that I have no clue how to actually link it to the content that I want it to scroll, which is really the important part!

I just have a movie clip that I would like to move up and down as the user drags my slider. Seems simple, but I have no clue, so any help would be greatly appreciated! Hopefully I have explained myself enough, but if not just ask for clarification and I will do my best. Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have also done a sample for your reference..

download it here:
http://www.4shared.com/file/3681880/825f31b3/slider_sample.html

Rgds
Aneesh
Avatar of plundquist
plundquist

ASKER

Awesome! I will give it a try here tonight and let you know!
The code you had me substitute in worked wonderfully! I couldn't get the sample work, kept saying "unexpected file format" when I tried to open it, but your first suggestion linked them right up!

The only other little issue I am having with it now is, the movie clip I am scrolling (myMovie) uses a mask, the content is a long list-type thing which I want to show within a certain rectangular area. Right now the part that is un-masked, I guess you would say, when the page loads just scrolls up to the top of the page and it never reveals the content below. I guess what I am asking is, how do you use the scroll and make the content that is being scrolled only be revealed within a "window"? Sorry if this is going out of the realm of my original question!

Thanks so much for your expertise!
here is the updated version,,
only masked area is visible during scrolling...

download link: http://www.4shared.com/file/3710682/183fab24/slider_sample.html


Rgds
Aneesh
I get the "Unexpected File Format" with this one, too. I am not sure what I am doing wrong. I hit "Download" at the bottom of the page, then once it downloads, I right-click and open Properties where I Unblock it. Then I try every way possible to open it, to no avail. Is there something else I should be doing?

Thanks!
You must be having Flash mx2004,
I have uploaded the FLash 8 file..

Ok,
here I have uploaded the Flash MX2004 version
http://www.4shared.com/file/3751294/a2725629/slider_sample.html


Rgds
Aneesh
Yes, I am using MX. I redownloaded and tried it again, and the same thing happened. Sorry!
Oh,
you are using MX which is even older version than MX2004.
I dont use MX anymore..

You need atleast Flash MX2004 to open this file..
Okay, sorry! Thanks for trying! I know you have already spent a ton of time on this question, but if you have time, would you want to walk me through the mask issue? Thanks so much for all of your help!!
My original question has been answered, and I think I branched out into another question altogether, so I will close this question, and see if I can get part 2 handled in a different question. Thanks so much for your quick response and expertise!!