                                      anchorPosition:int=-1, 
                                      activePosition:int=-1):void
     {
+        if (!(textDisplay is RichEditableText))
+            return;
+
+        RichEditableText(textDisplay).setFormatOfRange(
+                    format, anchorPosition, activePosition);
+    }
+
+    /**
+     *  @copy spark.components.RichEditableText#scrollToRange()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function scrollToRange(anchorPosition:int = 0,
+                                  activePosition:int = int.MAX_VALUE):void
+    {
         if (!textDisplay)
             return;
 
-        textDisplay.setFormatOfRange(format, anchorPosition, activePosition);
-    }
-
-    /**
-     *  @copy spark.components.RichEditableText#scrollToRange()
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function scrollToRange(anchorPosition:int = 0,
-                                  activePosition:int = int.MAX_VALUE):void
-    {
-        if (!textDisplay)
-            return;
-
         textDisplay.scrollToRange(anchorPosition, activePosition);
     }
 }

import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;

import mx.core.mx_internal;
import mx.core.ScrollPolicy;
import mx.events.FlexEvent;

import spark.components.supportClasses.SkinnableTextBase;

                                     anchorPosition:int=-1,
                                     activePosition:int=-1):TextLayoutFormat
    {
        if (!(textDisplay is RichEditableText))
            return null;

        return RichEditableText(textDisplay).getFormatOfRange(
                    requestedFormats, anchorPosition, activePosition);
    }

    /**
