                                      anchorPosition:int=-1,
                                      activePosition:int=-1):TextLayoutFormat
     {
-        if (!textDisplay)
+        if (!(textDisplay is RichEditableText))
             return null;
 
-        return textDisplay.getFormatOfRange(requestedFormats, anchorPosition, 
-                                            activePosition);
+        return RichEditableText(textDisplay).getFormatOfRange(
+                    requestedFormats, anchorPosition, activePosition);
     }
 
     /**

                                     anchorPosition:int=-1, 
                                     activePosition:int=-1):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.ScrollPolicy;
import mx.core.mx_internal;
import mx.events.FlexEvent;

import spark.components.supportClasses.SkinnableTextBase;
