# Image width set and height proportional problem. Help

**URL:** https://forum.kirupa.com/t/image-width-set-and-height-proportional-problem-help/263730
**Category:** flash
**Created:** [June 18, 2008, 6:52pm UTC](https://forum.kirupa.com/t/image-width-set-and-height-proportional-problem-help/263730 "2008-06-18T18:52:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mustang\_lex](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mustang\_lex](https://forum.kirupa.com/u/mustang_lex)
#### Post date: [June 18, 2008, 6:52pm UTC](https://forum.kirupa.com/t/image-width-set-and-height-proportional-problem-help/263730/1 "2008-06-18T18:52:20Z")

</div>

Hey Guys. I have this script that will load an external photo into a container. The problem is that the script is set to input an exact width and height. I would like it so I can set the width to like 150px and the height will adjust proportionally. Here is the script.

```auto

onClipEvent (load)
{
    orjx = 0;
    this._alpha = 0;
}
onClipEvent (data)
{
    this._x = orjx;
    this._y = 5;
    orjw = this._width;
    orjh = this._height;
    this._height = 137;
    this._width = 184 * orjw / orjh;
    if (this._width > 184)
    {
        this._width = 184;
        this._height = 137 * orjh / orjw;
        this._y = this._y + (137 - this._height) / 2;
    } // end if
    this._x = this._x + (184 - this._width) / 2;
    this._alpha = 100;
    _parent.play();
}

```
