      */
     static private function getRoundRectBoundingBox(width:Number,
                                                     height:Number,
-                                                    radiusX:Number,
-                                                    radiusY:Number,
+                                                    r:Rect,
                                                     m:Matrix):Rectangle
     {
         // We can find the round rect bounds by finding the 
         // bounds of the four ellipses at the four corners
         
         // Make sure that radiusX & radiusY don't exceed the width & height:
-        radiusX = Math.min(radiusX, width / 2);
-        radiusY = Math.min(radiusY, height / 2);
+        var maxRadiusX:Number = width / 2;
+        var maxRadiusY:Number = height / 2;
+        
+        var radiusX:Number = r.radiusX;
+        var radiusY:Number = r.radiusY == 0 ? radiusX : r.radiusY;
+        
+        function radiusValue(def:Number, value:Number, max:Number):Number
+        {
+            var result:Number = isNaN(value) ? def : value;
+            return Math.min(result, max);
+        }
         
         // FIXME (egeorgie): optimize to not allocate a new Rectangle?
         var boundingBox:Rectangle;
-
+        var rX:Number;
+        var rY:Number;
+        
         // top-left corner ellipse
-        boundingBox = MatrixUtil.getEllipseBoundingBox(radiusX, radiusY, radiusX, radiusY, m, boundingBox);
+        rX = radiusValue(radiusX, r.topLeftRadiusX, maxRadiusX);
+        rY = radiusValue(rX, r.topLeftRadiusY, maxRadiusY);
+        boundingBox = MatrixUtil.getEllipseBoundingBox(rX, rY, rX, rY, m, boundingBox);
+        
         // top-right corner ellipse
-        boundingBox = MatrixUtil.getEllipseBoundingBox(width - radiusX, radiusY, radiusX, radiusY, m, boundingBox);
+        rX = radiusValue(radiusX, r.topRightRadiusX, maxRadiusX);
+        rY = radiusValue(rX, r.topRightRadiusY, maxRadiusY);
+        boundingBox = MatrixUtil.getEllipseBoundingBox(width - rX, rY, rX, rY, m, boundingBox);
+        
         // bottom-right corner ellipse
-        boundingBox = MatrixUtil.getEllipseBoundingBox(width - radiusX, height - radiusY, radiusX, radiusY, m, boundingBox);
+        rX = radiusValue(radiusX, r.bottomRightRadiusX, maxRadiusX);
+        rY = radiusValue(rX, r.bottomRightRadiusY, maxRadiusY);
+        boundingBox = MatrixUtil.getEllipseBoundingBox(width - rX, height - rY, rX, rY, m, boundingBox);
+        
         // bottom-left corner ellipse
-        boundingBox = MatrixUtil.getEllipseBoundingBox(radiusX, height - radiusY, radiusX, radiusY, m, boundingBox);
+        rX = radiusValue(radiusX, r.bottomLeftRadiusX, maxRadiusX);
+        rY = radiusValue(rX, r.bottomLeftRadiusY, maxRadiusY);
+        boundingBox = MatrixUtil.getEllipseBoundingBox(rX, height - rY, rX, rY, m, boundingBox);
         
         return boundingBox;
     }

    [Inspectable(category="General")]
    
    /**
     *  The corner radius to use along the x axis.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10

    [Inspectable(category="General")]
    
    /**
     *  The default corner radius to use for the y axis on all corners. The 
     *  <code>topLeftRadiusY</code>, <code>topRightRadiusY</code>, 
     *  <code>bottomLeftRadiusY</code>, and <code>bottomRightRadiusY</code>
     *  properties take precedence over this property.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
