FXG Complex Rectangle Experiment

I’m a bit late to the party, but started really looking at Flex4 this week … FXG in particular. I looked over the few basic FXG Shapes (Rect, Ellipsis, and Line) and thought it looked pretty limited. I had used Degrafa on a few projects and really got used to the Round Rectangle Complex and the ability to set each rectangle corner with a different radius.  The FXG Rect has the ability to set corner radius, but its every corner and lacks the the control.  So… i figured with FXG the new standard for Adobe, I’d look at how hard it would be to create a custom FXG class.

Well, not too hard at all.  I started by looking at the Rect class in Flex, and then had to hunt around for simulate Cubic Beziers using the curveTo method (Thanks Senocular for that answer).

If you want to play around with it (requires Flash Player 10):Â View Source