PDA

View Full Version : How to reset scrollbar?


rap199
05-08-2008, 09:10 PM
Hi guys,

I'm using a scroll area that I bought, but at present the scroll bar doesn't reset when different frames are loaded. Can anyone help me with this? I'm using Flash CS3. I am new to flash, so if you have the patience to explain, i would really appreciate it.

The script for the scroller is LONG, so here are a few parts, that I think may be relevant:

function scrollContent() {
scroll_content.onEnterFrame = function()
scrollbar.slider._y = 0;
scrollbar.track._y = 0;
scrollbar._y = scroll_content._y;
initScroll();
delete scrollbar.slider.onEnterFrame

Im after the code to make the scrollbar reset and to know, where to put it.

Thank you!

ten90jwhite
05-08-2008, 10:54 PM
There is a method called ScrollPane.invalidate() that I think forces the scroll bar to update. If that doesn't work try ScrollPane.redraw(). I forget which it is, but only one of those works.

rap199
05-10-2008, 08:21 AM
Thanks for replying. I tried those but neither seemed to do the trick.
When a new frame loads (via a button in a different MC) it still opens at the same height as the previous frame was left.

Cheers