2 Replies Latest reply on May 13, 2010 1:34 PM by EliezerReis

    Manipulate Scroller pageSize

    EliezerReis

      Hey,

       

      I have the follow piece of code. You can see that I configure the pageSize of my VerticalScrollBar of my Scroller to 50. But, when I call vv.changeValueByPage()  the pageSize varies, always over 350 and the repeatInterval isn't applied. So, 350 is applied directly to verticalScrollPosition making a large jump in the viewport.

       

      <s:Scroller id="scroller" width="1000" height="100%" horizontalScrollPolicy="off">
           <s:verticalScrollBar>
                <s:VScrollBar stepSize="1" pageSize="50" repeatDelay="100" repeatInterval="1000"
                     valueCommit="commit(event)"/>
           </s:verticalScrollBar>
      
           ..... IViewPort ....
       
      </s:Scroller>
      

       

       

      Anyone there's some tip for this issue?

       

      Thanks

        • 1. Re: Manipulate Scroller pageSize
          EliezerReis Level 1

          I don't know why but when I configure viewport to VScrollBar or when viewport is configured to Scroller my pageSize deffined to VScrollBar is replaced. It's appear that pageSize is dynamically set by viewport. Viewports use the verticalScrollPositionDelta do scroll content and I can't change this property manually. So, anyone know  how I can interact programmatically with viewport to control the speed of scroll?

          • 2. Re: Manipulate Scroller pageSize
            EliezerReis Level 1

            ****, when viewport is configured to Scroller or some ScrollBar base component they "sdk" always use the delta to scroll content invalidating all user preference. Look the piece of code from sdk bellow. If viewport is configured they just pay attention to vertical delta position. I wanted use animation but passing my prefered amount of pixels.

             

                  var oldPageSize:Number;
                    if (viewport)
                    {
                        // Want to use ScrollBarBase's changeValueByPage() implementation to get the same
                        // animated behavior for scrollbars with and without viewports.
                        // For now, just change pageSize temporarily and call the superclass
                        // implementation.
                        oldPageSize = pageSize;
                        pageSize = Math.abs(viewport.getVerticalScrollPositionDelta(
                            (increase) ? NavigationUnit.PAGE_DOWN : NavigationUnit.PAGE_UP));
                    }
                    super.changeValueByPage(increase);
                    if (viewport)
                        pageSize = oldPageSize;
            

             

            And more, getVerticalScrollPositionDetal is based on bounds of the next non-visible element and, sometimes, it could be high.

             

            case NavigationUnit.PAGE_DOWN:
                // Find the bounds of the first non-fully visible element
                // that spans below the scrollRect.
                getElementBounds = getElementBoundsBelowScrollRect(scrollRect);
                break;
            

             

            So, just to know, its impossible without customization?