         width = newWidth;
         height = newHeight;
     }
+    
+    /**
+     *  @private
+     */
+    private function addedHandler(event:Event):void
+    {
+        invalidateLayoutDirection();
+    }
+    
+    /**
+     *  @private
+     *  Modifies the transform matrix so that this bitmap
+     *  will not be mirrored if a parent is mirrored.
+     */
+    private function validateTransformMatrix():void
+    {
+        // Save copy of current matrix
+        origMatrix = transform.matrix.clone();
+        
+        // Create new de-mirrored transform matrix
+        const mirrorMatrix:Matrix = transform.matrix;
+        mirrorMatrix.translate(-mirrorMatrix.tx, 0);
+        mirrorMatrix.scale(-1, 1);
+        mirrorMatrix.translate(_x + width, 0);
+        
+        transform.matrix = mirrorMatrix;
+    }
 }
 
 }

{

import flash.display.BitmapData;
import mx.core.FlexBitmap;

/**
 *  BitmapAsset is a subclass of the flash.display.Bitmap class

                                smoothing:Boolean = false)
    {
        super(bitmapData, pixelSnapping, smoothing);
        
        if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_0)
            this.addEventListener(Event.ADDED, addedHandler);
    }

    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------
    
    private var mirror:Boolean = false;
    private var origMatrix:Matrix;
    
    //--------------------------------------------------------------------------
    //
    //  Overridden Properties
    //
    //--------------------------------------------------------------------------
    
    //----------------------------------
    //  x
    //----------------------------------
    
    private var _x:Number = 0;
    
    /**
     *  @private
     *  In the mirroring case, we restore the old transform matrix,
     *  call the superclass' setter to recalculate the transform matrix,
     *  and call validateTransformMatrix to de-mirror the matrix.
     *  This ensures that the right matrix values are used when 
     *  de-mirroring.
     */
    override public function set x(value:Number):void
    {
        if (mirror)
        {
            transform.matrix = origMatrix;
            super.x = value;
            _x = value;
            validateTransformMatrix();
        }
        else
        {
            super.x = value;
        }
    }
    
    /**
     *  @private
     */
    override public function get x():Number
    {
        // FIXME(hmuller): by default get x returns transform.matrix.tx rounded to the nearest 20th.
        // should do the same here, if we're returning _x.
        return (mirror) ? _x : super.x;
    }
    
    //----------------------------------
    //  width
    //----------------------------------
    
    /**
     *  @private
     */
    override public function set width(value:Number):void
    {
        if (mirror)
        {
            transform.matrix = origMatrix;
            super.width = value;
            // Store new scaleX/Y since setting width may modify them
            _scaleX = super.scaleX;
            _scaleY = super.scaleY;
            validateTransformMatrix();
        }
        else
        {
            super.width = value;
        }
    }
    
    //----------------------------------
    //  height
    //----------------------------------
    
    /**
     *  @private
     *  We must override height as well because setting
     *  height will force scaleX to be positive in the transform
     *  matrix.
     */
    override public function set height(value:Number):void  
    {
        if (mirror)
        {
            transform.matrix = origMatrix;
            super.height = value;
            // Store new scaleX/Y since setting height may modify them
            _scaleX = super.scaleX;
            _scaleY = super.scaleY;
            validateTransformMatrix();
        }
        else
        {
            super.height = value;
        }
    }
    
    //----------------------------------
    //  scaleX
    //----------------------------------
    
    private var _scaleX:Number;
    
    /**
     *  @private
     */
    override public function set scaleX(value:Number):void
    {
        if (mirror)
        {
            transform.matrix = origMatrix;
            super.scaleX = value;
            _scaleX = value;
            validateTransformMatrix();
        }
        else
        {
            super.scaleX = value;
        }
    }
    
    override public function get scaleX():Number
    {
        return (mirror) ? _scaleX : super.scaleX;
    }
    
    //----------------------------------
    //  scaleY
    //----------------------------------
    
    private var _scaleY:Number;
    
    /**
     *  @private
     */
    override public function set scaleY(value:Number):void
    {
        if (mirror)
        {
            transform.matrix = origMatrix;
            super.scaleY = value;
            _scaleY = value;
            validateTransformMatrix();
        }
        else
        {
            super.scaleY = value;
        }
    }
    
    override public function get scaleY():Number
    {
        return (mirror) ? _scaleY : super.scaleY;
    }

    //--------------------------------------------------------------------------
