Groups | Blog | Home
all groups > flash actionscript > january 2004 >

flash actionscript : How do I keep scrollbar at top when dynamically loading new text?


BatteryLow
1/16/2004 10:47:41 PM
My problem is this:

I have three buttons within a swf movie. Each button dynamically loads text into the same holder with a scrollbar.

The problem is that if I scroll down while viewing one of the text options, and then click on button two to load option 2 text, the text is loaded at the same scrolling location as when I replaced option 1. So then I have to scroll back to the top every time after I load new text.

I want the text to load so that the scrollbar is always at the top (no matter where the scrollbar was during the previous text). What is the actionscript to do this?

Thanks in advance for your help!

spycat
1/22/2004 1:34:23 AM
give a target name to your scrollbar, in example myscrolllbar, then add this action to your buttons

myscrollbar.setScrollPosition(1);

AddThis Social Bookmark Button