Before Flex 4, if you were displaying vector graphics that were changing, your code needed to clear down the graphics object of your display class and re-render the graphics. What you couldn't do was, for example, simply change the position of the beginning or end of a line or curve. 

Flex 4 introduces something slightly different - declarative graphics. With these, you define graphics as an object and their properties can be bound. Here's a super simple, five minute demonstration. At the top of the page, I create a CubicBezierSegment (another new feature of Flex 4). 

The interesting thing about the Bezier segment is that all its properties - the positions of the start, control points and terminus and the weight and color of the stroke - are bound to a set of numeric steppers in the right hand panel. This means that when you change one of those steppers, there's no additional ActionScript - the Bezier curve redraws itself through the joy of binding.

This ain't no Raven - but if you're working with vector graphics, Flex 4 is the way to go.

The demo application is here and the source code is here.
1

View comments

About Me
About Me
Labels
Labels
Blog Archive
Loading