I think you should move

> var bigM:Matrix = big.transform.matrix.clone();
>
out of your box move handler, because box.x and box.y are positive even when
moving to left or top.

thomas
---
http://www.web-attitude.fr/
msn : [email protected]
softphone : sip:[email protected] <sip%[email protected]>
téléphone portable : +33601 822 056


2009/6/19 grimmwerks <[email protected]>

>
>
> 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