 import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.SoftKeyboardEvent;
+import flash.geom.Matrix;
 import flash.geom.Point;
 import flash.geom.Rectangle;
 import flash.system.Capabilities;

        {
            if (stageText.stage)
            {
                var globalTopLeft:Point = parent.localToGlobal(localViewPort.topLeft);

                // Transform the bottom-right corner of the local rect
                // instead of setting width/height to account for any
                // transformations applied to ancestor objects.
                var globalBottomRight:Point = parent.localToGlobal(localViewPort.bottomRight);
                var globalRect:Rectangle = new Rectangle();
                
                // StageText can't deal with upside-down or mirrored rectangles

import mx.managers.FocusManager;
import mx.managers.SystemManager;
import mx.managers.systemClasses.ActiveWindowManager;
import mx.utils.MatrixUtil;

import spark.components.Application;
import spark.core.IEditableText;
