To scale / rotate from the center of the object, you need to do the following
- Translate the object to 0.0.
- Scale / Rotate
- Translate it back to the original x, y.
Here is a piece of code that does this.
private function scaleInPosition(dis:Sprite,sX:Number,sY:Number):void { var posX:Number = dis.x; var posY:Number = dis.y; dis.x =dis.y = 0; dis.scaleX = sX; dis.scaleY = sY; dis.x = posX; dis.y = posY; }
source share