I'm referring to this statement:

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

When I move the border box left and right, the large image is moving in 
the opposite direction.  That part seems to be working.  The part that 
doesn't seem to be working is when moving the border box, the large box 
should be moving more than it actually is.  From looking at your code, I 
think you're trying to take scale into account but just doing it 
incorrectly.  I'm not a matrix pro (few people are, which is probably 
the reason you're getting few responses) and I haven't tested what I'm 
about to say, but here's my shot at it from my experience:

An object's tx and ty are unaffected by the object's scale.  In other 
words, if you translate an image that's a normal scale by 10 on both the 
x and y axis, it's the same as if you translate and image that's at 2x 
scale by 10 on both the x and y axis.  They're both still going to end 
up at 10, 10 in their parent.  So I think there are a couple ways to do 
what you're trying to do.  For starters I think you could get the 
x-change of your border box, multiply it by the large image's scaleX, 
then use that number to translate the large image.  Do the same kind of 
thing with Y.  Does that make sense?

Aaron

grimmwerks wrote:
>
>
> It can't possibly -- ie what you're seeing under the small viewer when
> scaled down doesn't match the large view at all.
>
> On Jun 20, 2009, at 11:21 AM, Aaron Hardy wrote:
>
> > I guess you figured it out? Your demo works for me.
> >
> > Aaron
> >
> > grimmwerks wrote:
> >>
> >>
> >> Argh -- still struggling. What am I missing?
> >>
> >>
> >>
> >> On Jun 19, 2009, at 5:03 PM, grimmwerks wrote:
> >>
> >>>
> >>>
> >>> But I need that to get the current state of the large transform
> >>> matrix.
> >>>
> >>> What I'm having problems with is this idea that the smaller area
> >>> maps
> >>> to the larger area; in Director there was an actual map() function
> >>> that doesn't seem to be in flash.
> >>>
> >>> It'd be great if the adobe guys could weigh in on this; ie I can't
> >>> be
> >>> the only person having trouble with Matrices / Transforms otherwise
> >>> I'd be getting a lot more responses.
> >>>
> >>> I'll try it as you say Thomas; thanks for responding.
> >>>
> >>> On Jun 19, 2009, at 4:28 PM, thomas parquier wrote:
> >>>
> >>>>
> >>>>
> >>>> 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/ <http://www.web-attitude.fr/> 
> <http://www.web-attitude.fr/ <http://www.web-attitude.fr/>>
> >>>> msn : [email protected] 
> <mailto:thomas.parquier%40web-attitude.fr>
> >>>> <mailto:[email protected] 
> <mailto:thomas.parquier%40web-attitude.fr>>
> >>>> softphone : sip:[email protected] 
> <mailto:webattitude%40ekiga.net>
> >>>> <mailto:sip%[email protected] 
> <mailto:sip%253Awebattitude%40ekiga.net>>
> >>>> téléphone portable : +33601 822 056
> >>>>
> >>>>
> >>>> 2009/6/19 grimmwerks <[email protected] 
> <mailto:grimm%40grimmwerks.com>
> >>>> <mailto:[email protected] <mailto:grimm%40grimmwerks.com>>>
> >>>>
> >>>>
> >>>>
> >>>> 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/ 
> <http://grimmwerks.com/examples/matrix/>
> >>>> <http://grimmwerks.com/examples/matrix/ 
> <http://grimmwerks.com/examples/matrix/>>
> >>>>
> >>>> **next up how to make the small view box locked to the viewer
> >>>> area in the startDrag...
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> > ------------------------------------
> >
> > --
> > Flexcoders Mailing List
> > FAQ: 
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
> <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>
> > Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
>  
> <https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847>
> > Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
> <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo>
> > ! Groups Links
> >
> >
> >
>
> 

Reply via email to