# Scale from Object Center after drag

**URL:** <https://forum.kirupa.com/t/scale-from-object-center-after-drag/309771>\
**Category:** flash\
**Created:** [May 24, 2010, 3:25pm UTC](https://forum.kirupa.com/t/scale-from-object-center-after-drag/309771 "2010-05-24T15:25:49Z")\
**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:** [May 24, 2010, 3:25pm UTC](https://forum.kirupa.com/t/scale-from-object-center-after-drag/309771/1 "2010-05-24T15:25:49Z")

</div>

I have had some help but still not understanding this.

How can I scale an object from center after it is dragged by the user?

Currently I have this:

function onSliderChange(e:SliderEvent):void  
{  
scaleClip(slider.value);  
}

function scaleClip(val:int):void  
{  
var trueScl:Number = val/100;  
holder\_mc.scaleX = holder\_mc.scaleY = trueScl;  
holder\_mc.x = clipNativeX-(holder\_mc.width/2);  
holder\_mc.y = clipNativeY-(holder\_mc.height/2);  
defineCrop()  
}

With this code the movieclip jumps back to the center of the stage each time I call the scaleClip() (move the slider). I would like the object to scale from it’s own center regardless of where it is on the stage.

Any help is greatly appreciated!
