I'm sure there must be SOMEONE on here (adobe?) that can explain how transforms work from one box to another scaled box...?

On Jun 19, 2009, at 1:03 PM, grimmwerks wrote:



I've got a little app that is the same old small viewer / large image type thing we all know and love.

I've got a slider that sets the scale - ie when the user zooms up, the large image zooms up and the 'box' canvas does the invert so that it shows what view the user is seeing -- dig?

Now I'm trying to allow the user to move the small box around and see that same view with the large image; I've tried the following which ALMOST works --when the user moves the box to the right (ie x+ + and y++) the large image goes to the left; but when the user moves it BACK the large image doesn't move back to the right.

private function boxMouseDrag(e:MouseEvent):void{
                                borderBox.transform = box.transform;
                                var bigM:Matrix = big.transform.matrix.clone();
                                var boxM:Matrix = new Matrix();
                                boxM.translate(box.x, box.y);
                                boxM.invert();
                                bigM.concat(boxM);
                                big.transform.matrix = bigM;
                                //big.transform.matrix.translate(box.x, box.y);
                                out.text = "dragging " + box.transform.matrix;
                        }


You can see an example here:

http://grimmwerks.com/examples/matrix/

**next up how to make the small view box locked to the viewer area in the startDrag...




Reply via email to