# Drag/Scale Object Help

**URL:** <https://forum.kirupa.com/t/drag-scale-object-help/267320>\
**Category:** flash\
**Created:** [July 30, 2008, 5:58pm UTC](https://forum.kirupa.com/t/drag-scale-object-help/267320 "2008-07-30T17:58:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MyronStanley](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@MyronStanley](https://forum.kirupa.com/u/MyronStanley)\
**Post date:** [July 30, 2008, 5:58pm UTC](https://forum.kirupa.com/t/drag-scale-object-help/267320/1 "2008-07-30T17:58:30Z")

</div>

Hey all,

Trying to fine tune, if possible, a drag scale movie clip functionality. I’m trying to get it to scale on the arrow instead of the whole image. Here is the code…

var OnScale:Boolean;

display01A.imageBg.imgArw.addEventListener(MouseEvent.MOUSE\_DOWN, sclStart, false, 0, true);  
this.display01A.addEventListener(MouseEvent.MOUSE\_UP, sclStop, false, 0, true);  
this.display01A.addEventListener(Event.ENTER\_FRAME, onLoop, false, 0, true);

function sclStart(evt:MouseEvent):void {(OnScale=true);  
}  
function sclStop(evt:MouseEvent):void {(OnScale=false);  
}

function onLoop(evt:Event):void {  
if (OnScale)  
{  
this.display01A.width = Math.max(mouseX - this.x, 10);  
this.display01A.height = Math.max(mouseY - this.y, 10);  
( this.display01A.scaleX \> this.display01A.scaleY ) ? this.display01A.scaleY = this.display01A.scaleX : this.display01A.scaleX = this.display01A.scaleY;  
}  
}

I can provide an fla if desired. Thanks in advance.

[http://www.geocities.com/oezian/drap\_scale.swf](http://www.geocities.com/oezian/drap_scale.swf)
