# How to change a clip's height without affecting the width?

**URL:** https://forum.kirupa.com/t/how-to-change-a-clips-height-without-affecting-the-width/311843
**Category:** Uncategorized
**Created:** [July 18, 2010, 1:25pm UTC](https://forum.kirupa.com/t/how-to-change-a-clips-height-without-affecting-the-width/311843 "2010-07-18T13:25:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![encaps](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@encaps](https://forum.kirupa.com/u/encaps)
#### Post date: [July 18, 2010, 1:25pm UTC](https://forum.kirupa.com/t/how-to-change-a-clips-height-without-affecting-the-width/311843/1 "2010-07-18T13:25:44Z")

</div>

Hello everybody!

There is movie clip “iGun” on the stage, when I change the clip’s height, the width becomes automatically scaled ( I don’t know why)  
simple sample :

```auto
            iGun.height = mouseScale * iGunH / 100;

```

Full code:

```auto

    public class Untitled extends MovieClip {
                
        public function Untitled():void { 
            stage.addEventListener(MouseEvent.MOUSE_MOVE, m_mouseMove);
        }
        
        function m_mouseMove(event:MouseEvent):void {
            var mouseAngle = Math.atan2(stage.mouseY - iGun.y,
                    stage.mouseX - iGun.x) * 180 / Math.PI + 270/Math.PI;
            iGun.rotation = mouseAngle;

            var iGunH:int = 200;
            var iGunW:int = 50;
            var mouseScale:int = (360 - mouseY) * 100 / 360;
**iGun.height = mouseScale * iGunH / 100;**

        }
                    

```

The demo:  
[http://www.encaps.net/software/flash/Untitled.swf](http://www.encaps.net/software/flash/Untitled.swf)

**The question: how to change the clip’s height, without affecting the width?**
