2 Replies Latest reply on Aug 25, 2011 1:51 AM by rxy25830

    How to set Grid scroll speed ?

    rxy25830

      When I scroll the mouse, many rows are skipped.

      Example as follows:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
            creationComplete="application_creationCompleteHandler(event)">

      <fx:Script>
        <![CDATA[
         import mx.containers.Grid;
         import mx.containers.GridItem;
         import mx.containers.GridRow;
         import mx.events.FlexEvent;
        
         import spark.components.Label;
        
         protected function application_creationCompleteHandler(event:FlexEvent):void {
          group.addElement(createGrid());
         }
        
         private function createGrid():Grid {
          var grid:Grid = new Grid();
          for (var i:int = 0; i < 300; i++) {
           grid.addChild(createRow2(i + 1));
          }
          return grid;
         }
        
         private function createRow2(idx:int):GridRow {
          var row:GridRow = new GridRow();
          var item:GridItem = new GridItem();
          var label:Label = new Label();
          label.text = idx + " test ......";
          item.addChild(label);
          row.addChild(item);
          return row;
         }
        ]]>
      </fx:Script>
      <s:Scroller width="100%" height="100%" >
        <s:VGroup id="group" width="100%" height="100%">
        
        </s:VGroup>
      </s:Scroller>
      </s:Application>