# MovieClips are randomly resizing when rotated

**URL:** https://forum.kirupa.com/t/movieclips-are-randomly-resizing-when-rotated/291681
**Category:** Uncategorized
**Created:** [July 3, 2009, 1:48am UTC](https://forum.kirupa.com/t/movieclips-are-randomly-resizing-when-rotated/291681 "2009-07-03T01:48:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JKhan](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JKhan](https://forum.kirupa.com/u/JKhan)
#### Post date: [July 3, 2009, 1:48am UTC](https://forum.kirupa.com/t/movieclips-are-randomly-resizing-when-rotated/291681/1 "2009-07-03T01:48:32Z")

</div>

Hello,  
I have been working on a project in which several MovieClips are being resized, rotated, blurred, and changing in alpha each frame. The rotation/blur/alpha is random, and the width and height are being set by a variable.

Strangely, when I play movie, the width and the height are visually varying randomly. Inexplicibly when I trace the width and the height of the MovieClips, I am getting the expected value.  
Initially, I thought this might have something to do with the stages perspective settings, but setting to export as Flash 9 didn’t help.  
I am quite perplexed, any assistance or suggestions would be appreciated.

```php

//the Mote class extends MovieClip
for (var j in motes)
{
    var m = motes[j];
    m.totalDA = 0;
    if (m.mass > 5)
    {
        for (var i in m.layer)
        {
            var ml = m.layer*;
            ml.da += Math.random()/m.ALPHACHANGEFACTOR;;
            ml.da -= Math.random()/m.ALPHACHANGEFACTOR;;
            m.totalDA += ml.da;
            ml.blur.blurX = 2 + Math.random() * 5;
            ml.blur.blurY = 2 + Math.random() * 5;
            var ta = new Array();
            ta.push(ml.blur);
            ml.mc.filters = ta;
            ml.dr += Math.random()/m.ROTATIONCHANGEFACTOR;
            ml.dr -= Math.random()/m.ROTATIONCHANGEFACTOR;
            ml.mc.rotation += ml.dr;
         }
    m.totalDA = Math.abs(m.totalDA);
    for (i in m.layer)
    {
       var ml = m.layer*;
       ml.mc.alpha = ml.da/m.totalDA;
       ml.mc.alpha = ml.da/m.totalDA;
    }
   }
   m.height = m.mass;
   m.width = m.mass;
}

```
