# Scale Moveclip From Any Point with Slider

**URL:** <https://forum.kirupa.com/t/scale-moveclip-from-any-point-with-slider/311713>\
**Category:** flash\
**Created:** [July 14, 2010, 4:03pm UTC](https://forum.kirupa.com/t/scale-moveclip-from-any-point-with-slider/311713 "2010-07-14T16:03:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcambron](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tcambron](https://forum.kirupa.com/u/tcambron)\
**Post date:** [July 14, 2010, 4:03pm UTC](https://forum.kirupa.com/t/scale-moveclip-from-any-point-with-slider/311713/1 "2010-07-14T16:03:51Z")

</div>

Greetings,

Any code suggestions for scaling a movieclip from a defined point. Currently I am using this function:

function scaleAroundPoint(objToScale:DisplayObject, regX:int, regY:int, scaleX:Number, scaleY:Number){  
if (!objToScale){  
return;  
}  
var transformedVector:Point = new Point( (regX-objToScale.x)_scaleX, (regY-objToScale.y)scaleY );  
objToScale.x = regX-( transformedVector.x);  
objToScale.y = regY-( transformedVector.y);  
objToScale.scaleX = objToScale.scaleX(scaleX);  
objToScale.scaleY = objToScale.scaleY_(scaleY);  
}

function call:  
scaleAroundPoint(holder\_mc, holder\_mc.x, holder\_mc.y, trueScl, trueScl);

What is happening is that when I change parameter 2 or 3 to the point I would like to scale from (upper right for example) the movie clip moves across the stage while the scale is being applied.

Any help is greatly appreciated.
