 	override public function set width(value:Number):void  
 	{
 		super.width = value;
+        // Set _scaleX because scaleX may change when width is set.
+        _scaleX = scaleX;
 		if (mirror)
 			validateTransformMatrix();
 	}

	/**
	 *  @private
	 *  Modifies the transform matrix so that this bitmap
	 *  will not be mirrored regardless of whether the closest
	 *  parent is mirrored.
	 */
	private function validateTransformMatrix():void
	{
		if (mirror)
		{
			const mirrorMatrix:Matrix = transform.matrix;
			if (mirrorMatrix.a > 0)
				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;
		}
	}
}


	 *  @private
	 *  We check the closest parent's layoutDirection property
	 *  whenever we change parents and set our mirror property
	 *  and update our transform matrix accordingly.
	 */
	private function addedHandler(event:Event):void
	{
		var p:DisplayObjectContainer = this.parent;
		
		while (p)
		{
			if (p is IVisualElement)
			{
                const oldMirror:Boolean = mirror;
                mirror = IVisualElement(p).layoutDirection == "rtl";
                if (mirror != oldMirror)
                    validateTransformMatrix();
				break;
			}
			
