# \[F8\]random scaling, but with random movement?

**URL:** https://forum.kirupa.com/t/f8-random-scaling-but-with-random-movement/208181
**Category:** flash
**Created:** [November 26, 2006, 1:42am UTC](https://forum.kirupa.com/t/f8-random-scaling-but-with-random-movement/208181 "2006-11-26T01:42:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![johnlouis](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/johnlouis/32/568_2.png) [@johnlouis](https://forum.kirupa.com/u/johnlouis)
#### Post date: [November 26, 2006, 1:42am UTC](https://forum.kirupa.com/t/f8-random-scaling-but-with-random-movement/208181/1 "2006-11-26T01:42:50Z")

</div>

i am a bit lost. i make a prototype function that randomly scales a box when i click on the stage. i got the scaling right, but why does it move around when it scales?  
here is the swf: [scaleEase](http://img132.imageshack.us/my.php?image=scaleeaselb3.swf)  
here is the code:  
[AS]MovieClip.prototype.scaleEaseTo = function(ease)  
{  
onMouseDown = function ()  
{  
newWidth = 1 + Math.random() \* 250;  
newHeight = 1 + Math.random() \* 250;  
};  
this.\_xscale += (newWidth - this.\_xscale) / ease;  
this.\_yscale += (newHeight - this.\_yscale) / ease;  
};  
dot.onEnterFrame = function()  
{  
scaleEaseTo(5);  
};  
[/AS]  
thanks in advance. 🙂
