10 Replies Latest reply on Jun 21, 2011 6:26 AM by Yan K.

    Rotate image sdk 3.X vs 4.5

    Yan K.

      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.translate(+offsetWidth, +offsetHeight);


      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