mattlundstrom
7/11/2012 - 8:00 PM

AS3 Scale Around Point

AS3 Scale Around Point

function scaleAroundPoint(target:DisplayObject, point:Point, scaleFactor:Number):void 
{ 
      var m:Matrix = target.transform.matrix; 
      m.translate( -point.x, -point.y ); 
      m.scale( scaleFactor, scaleFactor); 
      m.translate( point.x, point.y ); 
      target.transform.matrix = m; 

}