6 Replies Latest reply on Jun 7, 2009 9:04 AM by Eli7BBB

    Zooming in flex and the originX originY role




      I have an image. It's source comes from fla, and is a movie clip with children nested in it.

      I am assigning an eventlistener so when I click on one of the nested movie clips, I want to zoom where I clicked.


      I tried using the example source code which demonstrate zooming:





      <?xml version="1.0" encoding="utf-8"?>



      xmlns:mx=http://www.adobe.com/2006/mxml backgroundAlpha="0">









      id="zoomIn" zoomWidthTo="1" zoomHeightTo="1" />



      id="zoomOut" zoomWidthTo=".5" zoomHeightTo=".5" />





      title="Zoom Demo" width="100%" height="100%" horizontalAlign="center">




      text="Mouse over the image to enlarge it"/>




      id="canvas" width="100%" height="100%">








      <mx:Image id="img" x="{canvas.width/2 - img.width/2}" y="{canvas.height/2 - img.height/2}"

      source="@Embed('../assets/some_jpg_file.jpg')" scaleX=".5" scaleY=".5"


      zoomIn" rollOutEffect="zoomOut"/>











      This works OK but zooms from the center. I thought if I change the originX originY parametes to the x,y location of where I clicked, I will

      be able to zoom to that point. But that does not work correctly.

      Has any one used the originX originY parametes before ???