• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Rotate image sdk 3.X vs 4.5

New Here ,
Jun 11, 2011 Jun 11, 2011

Copy link to clipboard

Copied

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

Views

389

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 12, 2011 Jun 12, 2011

Copy link to clipboard

Copied

LATEST

Please post this in the Flex general discussions forum.

-Anirudh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines