/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private function rotateAroundInternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void { var p:Point = m.transformPoint(new Point(x, y)); rotateAroundExternalPoint(m, p.x, p.y, angleDegrees); } private function rotateAroundExternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void { m.translate(-x, -y); m.rotate(angleDegrees * (Math.PI / 180)); m.translate(x, y); }
URL: http://www.joelconnett.com/flex-rotation-around-a-point.html