# Smooth Scaling/Repositioning

**URL:** <https://forum.kirupa.com/t/smooth-scaling-repositioning/179422>\
**Category:** flash\
**Created:** [February 20, 2006, 3:33am UTC](https://forum.kirupa.com/t/smooth-scaling-repositioning/179422 "2006-02-20T03:33:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [February 20, 2006, 3:33am UTC](https://forum.kirupa.com/t/smooth-scaling-repositioning/179422/1 "2006-02-20T03:33:50Z")

</div>

I have an mc that i want to scale smoothly, see attached image that explains it…

heres my code

```auto

shrinkMap = function (target_MC:MovieClip, target_WDTH:Number, target_HGHT:Number, target_X:Number) {
    target_MC.onEnterFrame = function() {
        if (target_MC._width>target_WDTH) {
            target_MC._width -= target_MC._width/20;
        } else {
            target_MC._width = target_WDTH;
        }
        // 
        if (target_MC._height>target_HGHT) {
            target_MC._height -= target_MC._height/20;
        } else {
            target_MC._height = target_HGHT;
        }
        // 
        if (target_MC._x<target_X) {
            target_MC._x += (target_X-target_MC._x)/5;
        } else {
            target_MC._x = target_X;
        }
        if (target_MC._width == target_WDTH && target_MC._height == target_HGHT && target_MC._x == target_X) {
            delete target_MC.onEnterFrame;
        }
        // 
    };
};

```

It looks really jerky, the different bits finish before each other…is there a way of making each bit (height width and x) scale in proportion of each other so they all finish at the same time? I bet its something to do with what i divide the -= values by (currently arbitrary numbers like 20 or 5)
