Transformational Canvas v1.0
I wanted to create a Flex Canvas-based component that acted like a camera looking down on a tabletop containing objects. Any item added to the canvas would automatically be able to be dragged as a group and individually, while the whole view could be zoomed and rotated. Here is the result:
This component uses the Draggable Behavior classes described in this post.
By default the canvas center point is the center of the canvas, obtained by retrieving one half of the width and height of the canvas. This way the center point always remains in the center (+/- the x,y center point offsets) of the canvas even if the canvas is resized. However, the center point can be made to remain at a specific x,y coordinate by binding the x,y center point offset to negative one half the width and height of the canvas and adding x and y values of a desired amount. The following example keeps the center point at the x,y coordinates 100,100, even if the canvas is resized:
<ab:TransformationalCanvas id="tcanvas" centerPointOffsetX = "{-(tcanvas.width/2)+100}" centerPointOffsetY = "{-(tcanvas.height/2)+100}" >
Also, note that the Transformational Canvas origin x,y (0,0) coordinate is at the center point, not at the upper-lefthand corner. That means that children placed at 0,0 will appear at the center point, not at the upper-lefthand corner.
Please post bugs, questions, etc.

September 9th, 2009 at 10:16 am
Can this example be ported on flash cs4?
September 10th, 2009 at 5:10 am
Hi Maxim,
Sure, this could be ported to Flash CS4. The Flex Framework makes it easy to add UI components, but there’s nothing heavily dependent on the Flex Framework in the source code that couldn’t be altered to work in pure AS3. Thanks for the comment, it’s good to know that there would be demand to have this in Flash.