1 Reply Latest reply on Jun 12, 2011 11:26 PM by Anirudh Sasikumar

    Rotate image sdk 3.X vs 4.5

    Yan K. Level 1

      Hi All,

       

      I have to rotate image object around it's center.

      When used SDK 3.5 the following code worked perfect:

       

      var radians:Number = 90 * (Math.PI / 180.0);

      var offsetWidth:Number = img.contentWidth/2.0;

      var offsetHeight:Number =  img.contentHeight/2.0;

       

      var matrix:Matrix = new Matrix();

      matrix.translate(-offsetWidth, -offsetHeight);

      matrix.rotate(radians);

      matrix.translate(+offsetWidth, +offsetHeight);

      matrix.concat(img.transform.matrix);

      img.transform.matrix = matrix;

       

       

      Now when using SDK 4.5 the image is rotated around its left top corner no matter what.

      Anyone has a clue what is the difference and how to fix it?

       

      Thanks, Yan