This content has been marked as final. Show 6 replies
"Holomew" <email@example.com> wrote in message
>I have some canvases (canvasi?) that I want to make look like buttons with
> rounded corners and bevels, maybe a drop shadow, but I know this can't be
> to a canvas.
> Ideally, I like the way panels look but I don't want the white space in
> middle of it.
> I also like buttons but I'm not sure if I can use a button like a layout
> The item needs to have room for some text (a label), a graphic, and it
> needs to work like a button (meaning it can be clicked and can navigate
> store some information).
> Any ideas?
Canvas _does_ have a cornerRoundness style and a filters property.
There's a cornerRadius but it doesn't show rounded corners like the panels do. I'm not sure what else to use.
Don't have Flex 3 here to test (just 2) but on 2...
cornerRadius only works if you set borderStyle to "solid".
Gets it pretty close... I suspect that trying to get Canvas to do anything it's not "supposed" to do is going to be more trouble than it's worth, and Canvas really seems to be your best bet unless you're willing to just use Panel.
Also I've never used it but I think there's a borderSkin prop you can set as well, if you're really picky.
"Ansury" <firstname.lastname@example.org> wrote in message
> cornerRadius only works if you set borderStyle to "solid".
> dropShadowColor="#000000" dropShadowEnabled="true"
> Gets it pretty close... I suspect that trying to get Canvas to do anything
> it's not "supposed" to do is going to be more trouble than it's worth, and
> Canvas really seems to be your best bet unless you're willing to just use
Oh, thanks for that :-). I had some Canvas itemRenderers that I couldn't
get to show a rounded corner no matter what I did. Added a 0 width solid
border et voila! I had no idea the two properties were connected.
That's great, thanks!
What's more is you can also apply shadowDirection and shadowDistance. I'm not sure why Adobe doesn't standardize these effects for different objects.
I also really wish there was a bevel option.
Just out of curiosity, wouldn't I be able to use a button as a panel if I wanted to? I could still place labels, images, VBox, HBox, inside of a button, no?
Cool, no prob. As for using a button I wouldn't try it even if it worked, due to the "it's not designed for that" principle. Plus you'd probably still get that "click" effecting the whole "button/canvas" when any component was clicked... click events fired.. who knows.