clipContent only clips as rectangles, so it won't round the corners.  I
believe rounded corners refers to the appearance of the border only.  If you
want to accomplish the effect you're looking for, you're going to have to
use a mask.  Masks aren't my specialty, but here's what I think you want to
do.  Create a bitmap copy of the canvas (an example of how to create a
bitmap from an object is in the API docs for BitmapData.draw()).  Draw this
bitmap onto a new Sprite or UIComponent using graphics.beginBitmapFill().
Then set canvas.mask = the new sprite.

- Dan Freiman

On 12/9/06, Matt Maher <[EMAIL PROTECTED]> wrote:

  I am trying to make a canvas (with rounded corners) clip the content
inside of itself. It flat doesn't work. The clipping occurs, but the rounded
corners are not taken into account, so the content inside is clipped to the
square canvas. I have source below. Copy and paste that into the Flex
Online Compiler <http://try.flex.org/index.cfm>  (link: 
http://try.flex.org/index.cfm
) between the application tags to see what I am talking about.

Is this a described behaviour? You will notice that I also put
clipContent="true" on the canvas in hopes that would actually help.

Is there another way to produce the behaviour I'm looking for?





<mx:HBox width="100%" height="100%" horizontalAlign="center"
verticalAlign="middle">
    <mx:Canvas cornerRadius="25" clipContent="true"
        backgroundColor="#0000FF" borderStyle="solid" width="150"
height="200" horizontalScrollPolicy="off">
        <mx:HBox backgroundColor="#FF0000" >
            <mx:Label text="This is text long enough to get clipped"/>
        </mx:HBox>
    </mx:Canvas>
</mx:HBox>




Reply via email to