flex4 - Flex 4: Scale to a point (zoom into an image where the mouse was clicked) -
I am trying to do this and I do not know this. There is a image
control, when I click on it, I need to zoom in (using the center / mouse instead of the click)
The zoom transition I have is great work, but when I read transformX
& amp; tranformy
(with autoCenterTransform
false) it does not zoom in at that point
This is my code which only zooms (not at any particular point))
& Lt; / S: parallel & gt; & Lt; / Fx: Announcements & gt; & Lt; Mx: image id = "imgLogo" width = "250" x = "100" y = "100" retype = "true" source = "@ Embed ('src / logo.png')" click = "ImgLogo_clickHandler (event)" />
Any help is greatly appreciated. Thanksgiving
After some more excavation, I was able to understand it. You need to set the MouseEvent
to transformX
and transformY
step coordinates (not the locals).
protected function imgLogo_clickHandler (Event: MouseEvent): zero {scaleImg.transformX = event.stageX; ScaleImg.transformY = event.stageY; Transformer.play (); }
and modify the declaration for scale
& lt; S: Scale ID = "Scale IMG" scale XBy = "0.5" scale Yby = "0.5" autoCenterTransform = "false" />
Comments
Post a Comment