4 Replies Latest reply on Aug 5, 2009 6:54 AM by David_F57

    Spark Scroller functionality


      Does anyone know how to manually control the scroll position of the Spark Scroller component? I want to use buttons to scroll the content by a very specific amount creating a paging effect.

        • 1. Re: Spark Scroller functionality
          Poobeard Level 1

          sorry ... it's the Scroller's child that has the scrollPosition property.


          Also, if you want to use some custom buttons for scrolling just skin the Scroller instead.

          • 2. Re: Spark Scroller functionality
            David_F57 Level 5

            Or you could use animation to scroll the required amount for any container  (even add in extra paging effects)



                      <s:Animate id="scroll_by" target="{myContainer}" repeatCount="1" duration="5000">

                           <s:SimpleMotionPath property="horizontalScrollPosition" valueBy="{ScrollVal}"/>




            for left and right scroll


            protected function scroll_left(event:MouseEvent):void


            ScrollVal = -100



            protected function scroll_right(event:MouseEvent):void


            ScrollVal = 100




            for up and down just change to motionpath property to verticalScrollPosition or have a separate animation



            This gives you a nice smooth pageing effect if thats what you are trying to get.



            • 3. Re: Spark Scroller functionality
              Poobeard Level 1

              hey, that's exactly what I'm doing ... right this second! you're a mind reader.


              I looked into skinning the Scroller and there are limitations to what you can do as far as layout goes with the Scroller. If you want to create something unusual you need to create seperate VScrollBar and HScrollBar components and link them with a Viewport. Then you can create a custom skin for the scrollbars and make them look any way you want. Lesson learned = don't try and do that with the Scroller though.

              • 4. Re: Spark Scroller functionality
                David_F57 Level 5

                I do it for image lists a lot, I go a bit further by using a mouse over event for each button that starts the scroll then a mouse out which stops the scroll.