1 Reply Latest reply on Nov 29, 2010 1:33 AM by celebritymusic

    Control over the scrollPane component.




      I've got some moveieClips in container in a scrollpane component.


      The movieClips are draggable.


      I'd like to add extra functionality where if an item is dragged and touches the bottom of the scrollpane, it automatically scrolls up, and the reverse if you touch the top with a dragged object.


      I tried the scrollDrag, but I only want it to scroll once the dragged item touches the bottom or top.


      So I wrote this and put it in the drag function:


          if  ((this.hitTestObject(MovieClip(this.root).rowsHolderTopLine))  && MovieClip(this.root).rowsHolder.y < 200)
                  MovieClip(this.root).rowsHolder.y = MovieClip(this.root).rowsHolder.y+10;
                  this.y = this.y-10;


      It needs a bit of work, and I think I can get it working, but the one thing I'm stumped on is how to make the scrollbar move too.  Is there a way to communicate with the component using code (I created this component from the component inspector)?