Frédéric v. Bochmann wrote:
I forgot something...true.
Change it to something like:

var scrollRatio = scrollBar.slider._y / scrollBar.scrollTrack._height;
var heightToScroll = currentChild._height -
currentChildContainerMask._height;
if(heightToScroll < 0) {
  heightToScroll = 0;
}
currentChild._y = - scrollRatio * heightToScroll;


Where currentChildContainerMask._ height is the height of the Mask that is
masking your currentChild, or simply the height of the outline that is
representing the visible area of your currentChild as its being scrolled.
So basically heightToScroll is equal to the height of your currentChild that
is invisible to the user, it's the part you want to be able to scroll for.

Hope that helps :)
Fredz./

Cool, that's working properly now.
        
var offset = 108;
var scrollRatio = scrollBar.slider._y / (scrollBar.track._height-30);
        
var heightToScroll = currentChild._height - whichMask._height;
if(heightToScroll < 0) {
        heightToScroll = 0;
}
currentChild._y = (- scrollRatio * heightToScroll) +offset;

the (scrollBar.track._height-30) is because the slider is 30 tall, and so it never goes beyond scrollBar.track._height-30. The slider is non-proportional at the moment.

I was thinking it wasn't working, until I realised that I was cheating with the height of the mask, and hiding it behind a solid white block at the bottom of the screen! <guilty look>

Once I've got that sorted, I just need to make the slider move when I click on the arrows. What is the best way to do that? Make the arrows move the slider, and then update the content as before?

Thanks for all your help :>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to