2 Replies Latest reply on Jun 7, 2010 12:59 AM by monkeymagiic

    Listen to when spark scroller is scrolling


      Hi Flex


      I suppose the title/header describes what I'm looking for,


      Which event would I hook into to trigger event when a user is currently scrolling a spark component (In this case a spark list)


      Many Thanks



        • 1. Re: Listen to when spark scroller is scrolling
          Shongrunden Adobe Employee

          One way is to listen for the "propertyChange" event on the layout of a spark container and then check if the change was on the verticalScrollPosition or horizontalScrollPosition properties.


          For example:

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      import mx.events.PropertyChangeEvent;
                      private function init():void {
                          list1.layout.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, handle);
                      private function handle(e:PropertyChangeEvent):void {
                          if (e.property == "verticalScrollPosition" ||
                              e.property == "horizontalScrollPosition"){
                              trace("scroll position changed");
              <s:List height="50" id="list1">