Frédéric v. Bochmann wrote:
"As you can see I've currently got the slider clip as a child of the
scrollBar clip - should I bring it out to the same level?"

On that matter, I would say, look carefully at your line of code that
follows: (scrollBar._height - scrollBar.slider._y)

If the slider is scrolled higher than _y = 0 or that the slider goes lower
than scrollBar._height your slider will influence the scrollBar._height
value. This can be quite dangerous for weird acting script, but if your sure
your slider won't ever influence it's containers height, your Ok.

I have the slider being constrained by the startDrag function to be within the scrollBar clip at all times, so it should be ok.

What I might suggest you would be to use the scrollBar.scrollTrack._height
that might be existent or not in your scrollBar movieclip.

Yes, it is, I'll try that.

Now for your script, I don't usually go that way of doing it so here is how
I'd probably do it myself:

var scrollRatio = scrollBar.slider._y / scrollBar.scrollTrack._height;
currentChild._y = - scrollRatio * currentChild._height;

I'm not 100% sure but I think this should work. Notice the negative value
for the currentChild._y.

Thanks, I'll see how that behaves.

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to