             return 0;
             
         var maxDelta:Number = contentHeight - scrollR.height - scrollR.y;
-        var minDelta:Number = -scrollR.y; 
+        var minDelta:Number = -scrollR.y;
+        
+        var flowComposer:IFlowComposer = textFlow.flowComposer;
             
         switch (unit)
         {
             case ScrollUnit.UP:
-                return (scrollR.y <= 0) ? 0 : -1;
+            {
+        		return !flowComposer || flowComposer.numControllers == 0 ?
+            		   0 :
+            		   flowComposer.getControllerAt(0).scrollLines(-1);
+            }
                 
             case ScrollUnit.DOWN:
-                return (scrollR.y >= maxDelta) ? 0 : 1;
+            {
+        		return !flowComposer || flowComposer.numControllers == 0 ?
+					   0 :
+					   flowComposer.getControllerAt(0).scrollLines(1);
+            }
                 
             case ScrollUnit.PAGE_UP:
+            {
                 return Math.max(minDelta, -scrollR.height);
+            }
                 
             case ScrollUnit.PAGE_DOWN:
+            {
                 return Math.min(maxDelta, scrollR.height);
+            }
                 
-            case ScrollUnit.HOME: 
+            case ScrollUnit.HOME:
+            {
                 return minDelta;
+            }
                 
-            case ScrollUnit.END: 
+            case ScrollUnit.END:
+           	{
                 return maxDelta;
+            }
                 
             default:
+            {
                 return 0;
+            }
         }       
     }
     

import flashx.textLayout.operations.SplitParagraphOperation;

import mx.core.IViewport;
import mx.core.mx_internal;
import mx.core.UIComponent;
import mx.core.ScrollUnit;
import mx.events.FlexEvent;
import mx.events.TextOperationEvent;
import mx.utils.StringUtil;

import flashx.textLayout.formats.IContainerFormat;
import flashx.textLayout.formats.IParagraphFormat;
import flashx.textLayout.formats.ParagraphFormat;
import flashx.textLayout.operations.CutOperation;
import flashx.textLayout.operations.DeleteTextOperation;
import flashx.textLayout.operations.FlowOperation;
