# Help with scrollbar

**URL:** <https://forum.kirupa.com/t/help-with-scrollbar/253609>\
**Category:** flash\
**Created:** [March 3, 2008, 2:46pm UTC](https://forum.kirupa.com/t/help-with-scrollbar/253609 "2008-03-03T14:46:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SopaSeco](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SopaSeco](https://forum.kirupa.com/u/SopaSeco)\
**Post date:** [March 3, 2008, 2:46pm UTC](https://forum.kirupa.com/t/help-with-scrollbar/253609/1 "2008-03-03T14:46:45Z")

</div>

I have a scrollbar, this charge some external text, but the trouble is the next. I charge different text in the same text box when i move the scroll to down and charge another text the scroll continue in the same position i left the last time. I need when i change the text this begging in the 0 position.

This is the code i used in the scroll.

```auto
function FNSCROLL(){
   if(this.scrollText != undefined ){      
      if(this.scrollText.maxscroll==1){
         if(this._visible) this._visible=false;
      }
      else{
         if(!this._visible)this._visible=true;
      }      
      this.slyder.clear();
      this.slyder.lineStyle(1,0xFAC18A,100);
      this.slyder.moveTo(0,0);
      this.slyder.lineTo(0,this.scrollText._height-1);      
      this.rectwrapper._y=this.scrollText._height-this.rect wrapper._height;
      if(this.pressUp){
         if(this.scrollText.scroll>0){
            this.scrollText.scroll-=1;
            this.dragger._y = 10+int( (this.scrollText._height-30)*(this.scrollText.scroll-1) / this.scrollText.maxscroll );
         }
      }      
      if(this.pressDown){
         if(this.scrollText.scroll<this.scrollText.maxscroll){
            this.scrollText.scroll+=1;
            this.dragger._y = 10+int( (this.scrollText._height-30)*(this.scrollText.scroll-1) / this.scrollText.maxscroll );
         }
      }      
      if(this.dragging){
         var loc = this.dragger._y;
         var yDragged = loc-10;
         var newScroll = this.scrollText.maxscroll*yDragged /(this.scrollText._height-30);         
         this.scrollText.scroll=1+int(newScroll);
      }
      
   }
}

```

and this to charge the external texts

```auto

onClipEvent(load){
   this.scrollText=_level0.myText1;
   this.onEnterFrame=_level0.FNSCROLL;
}

```

I think so the answer is when i charge the text in the text box. But i not sure
