4 Replies Latest reply on Jul 12, 2011 9:46 AM by lirask8

    Spark List disable Scrolling

    ne_polle Level 1



      I'm using a List and I disabled the scrollpolicy und allowed the hole drag/drop stuff.


      The visible rows are smaller than the existing ones.


      Problem when I try to drag/drop an list-item I could scroll through the hole content of the list.


      I want to disble the scrolling effect.


      How could I do this???



      thanks for any advive and regards

        • 1. Re: Spark List disable Scrolling
          Gregory Lafrance Level 6

          Perhaps set the dropEnabled property to false?


          If this post answers your question or helps, please mark it as such. Thanks!

          Adobe Flex Development and Support Services

          • 2. Re: Spark List disable Scrolling
            ne_polle Level 1

            hmm thats the point.


            I want to see a small view of the hole list and I also want to have the drag/drop/drag-move possibilities.


            I did a little bit workaround as I tried this with the mx:List component. I reseted the vertical scroll position to zero when the ScrollEvent.SCROLL was catched.


            the s:List component doesn't interact with the ScrollEvent.


            Any other advice???

            • 3. Re: Spark List disable Scrolling
              Shongrunden Adobe Employee

              I'm not sure if this is the best way of doing this, but what about detecting scroll position changes and preventing changes:









                          import mx.events.PropertyChangeEvent;

                          import mx.managers.DragManager;


                          private var storedVSP:Number = 0;


                          private function init():void {

                              list2.dataGroup.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, handle);



                          private function handle(e:PropertyChangeEvent):void {

                              if (DragManager.isDragging && e.property == "verticalScrollPosition"){

                                  trace('verticalSrollPosition trying to go to', e.newValue, 'changing to', storedVSP);                   

                                  e.target.verticalScrollPosition = storedVSP;




                          private function storeCurrentScrollPosition():void {

                              storedVSP = list2.dataGroup.verticalScrollPosition;







                      <s:HorizontalLayout />



                  <s:List id="list1" height="100" dragEnabled="true" mouseDown="storeCurrentScrollPosition()">










                  <s:List id="list2" height="100" dropEnabled="true">











              • 4. Re: Spark List disable Scrolling

                You can try: MyList.scroller.enabled = false;