Flex 3 Experiment: Drawing a path at run time with insert points
Continuing from my previous post about how to draw a curve with editable points at run time, I decided to post a new one, on how to make draw a path (with straight lines) that include points to insert additional segments. Again, this is based on the book: “Foundation ActionScript 3.0 Image Effects” by Todd Yard.
By clicking a light red point between any two black points you can bisect the segment creating a new black point for manipulation, adding another light red point and repositioning the previous moved one and the new light red points to the center of their corresponding segments. In addition, any black point can be clicked and dragged to change the location of that point. It easier to understand by drawing a path. to do that, click on the canvas below a couple of times. Then move the black points to modify the path or the light red circles to add new segments. This requires Flash Player 10. Grab the code here.