5 Replies Latest reply on Feb 22, 2007 3:56 AM by RajeshBhadra

# rotate an image about it centre point

Can some one please tell me how to rotate an image about its centre point in flex 2.0?

I've tried using .rotation and looked at matrix transformation but I can't find a way to set the roatation to the centre of the image :(
• ###### 1. Re: rotate an image about it centre point
Easiest way is to combine three transformations - translate center to origin, rotate, translate center to previous position. Any transformation matrix that does this in one move just encapsulates the mathematics of these three steps.
• ###### 2. Re: rotate an image about it centre point
You can combine <mx:Move> with <mx:Rotate> effects together.

ps
I would LOVE to see example of applying matrix transformation to achieve the similar effect, cannot figure out yet by myself how to achieve it...
• ###### 3. Re: rotate an image about it centre point
Actually, mx:Rotate effect has originX and originY properties...

<mx:Rotate id="rotate" originX="{this.width/2}"
originY="{this.height/2}"
• ###### 4. Re: rotate an image about it centre point
Actually, mx:Rotate effect has originX and originY properties...

<mx:Rotate id="rotate" originX="{this.width/2}"
originY="{this.height/2}"
• ###### 5. Re: rotate an image about it centre point
Yes,mx:Rotate effect has originX and originY properties...

<mx:Rotate id="rotate" originX="{myObject.x + myObject.width/2}"
originY="{myObject.y + myObject.height/2}" />

<mx:Component id="myObject" x="200" y="200" />