3 Replies Latest reply on Jul 11, 2011 3:06 PM by Chris W. Griffith

    Increase Scroll Button Increments?




      I've created a horizontal scroll panel and have left/right buttons to move ... yes you guessed it ... left and right.

      But ... when you click left or right it moves such a small amount .. maybe in 3 or 4 pixels worth.


      Is there anyway to change this default setting? Is it an increment setting?

      Ideally I would like to set it to move 15 to 20 pixels left or right when clicked.




        • 1. Re: Increase Scroll Button Increments?
          Chris W. Griffith Adobe Community Professional

          The scroll amount is based on the overall size of the scrolling content. You can override this by writing your own custom scroll code in Flash Builder.



          • 2. Re: Increase Scroll Button Increments?
            NicoDesignLakes Level 1

            Hi Chris,


            Thanks for your reply.


            Can I check is this a case of changing some existing code or adding new code?


            I've gone into the FlashBuilder project > components > then there are several .mxml files per scroll panel including:

            - OutsidePan.mxml

            - OutsidePanNav2.mxml

            - OutsidePanNav2LeftButtonSkin.mxml

            - OutsidePanNav2RightButtonSkin.mxml

            - OutsidePanNav2ThumbSkin.mxml

            - OutsidePanNav2TrackSkin.mxml

            - OutsidePanScrollingContentSkin.mxml


            Is it in the top level 'OutsidePan.mxml' or on each of the sub component 'Left/RightButtonSkin.mxml' file that you would expect to change the increment code?


            In the OutsidePan.mxml file I can see increment setting in this line:


            <s:Button id="incrementButton" x="486" y="0"


            <s:Button id="decrementButton" x="0" y="0"


            <s:Button id="track" x="42" y="282" skinClass="components.OutsidePanNav2TrackSkin"/>

            <s:Button id="thumb" x="235" y="271" skinClass="components.OutsidePanNav2ThumbSkin"/>



            Am I in the right place? What do I need to change to say make a click go 10x further than it currently is ... 10% of the image would be ok.


            While we are here ...  is there a similar way to set the thumb to the center of the scroll track on start up? Would that be a code change done in the 'OutsidePanNav2ThumbSkin.mxml'


            Many thanks,


            • 3. Re: Increase Scroll Button Increments?
              Chris W. Griffith Adobe Community Professional

              No. Those just define the visual look. You need to make the scroll increments values via another method (or center the thumb). Take a look at using the selectedIndex property and the scrollToIndex method on the list.