         styleChangedFlag = false;
         invalidateDisplayListFlag = false;
     }
-
+    /**
+     *  @private
+     *  Update the transform.matrix based on the mirror flag.  This method must be 
+     *  called when x, width, or layoutDirection changes.
+     */
+    private function validateTransformMatrix():void
+    {
+        if (mirror)
+        {
+            const mirrorMatrix:Matrix = this.transform.matrix;
+            mirrorMatrix.a = -1;
+            mirrorMatrix.tx = _x + width;
+            transform.matrix = mirrorMatrix;
+        }
+        else // layoutDirection changed, mirror=false, reset transform.matrix to its default
+        {
+            const defaultMatrix:Matrix = new Matrix();
+            defaultMatrix.tx = _x;
+            defaultMatrix.ty = y;
+            transform.matrix = defaultMatrix;
+        }
+    }
+    
     /**
      *  Returns the TextFormat object that represents 
      *  character formatting information for this UITextField object.

     *  @private
     */
    private var untruncatedText:String;

    //--------------------------------------------------------------------------
    //
    //  Overridden properties
    //
    //--------------------------------------------------------------------------
    
    //----------------------------------
    //  htmlText


        if (!isNaN(explicitHeight) && super.height != explicitHeight)
            super.height = explicitHeight;
        
        // Update transform.matrix to compensate for layout mirroring
        if (styleChangedFlag)
        {
            const oldMirror:Boolean = mirror;
            mirror = getStyle("layoutDirection") == "rtl";
            if (mirror || oldMirror)
                validateTransformMatrix();
        }

        // Set the text format.
        if (styleChangedFlag)
        {
            var textFormat:TextFormat = getTextStyles();
