# How to SCALE a movieClip proportionately with onResize

**URL:** <https://forum.kirupa.com/t/how-to-scale-a-movieclip-proportionately-with-onresize/245950>\
**Category:** flash\
**Created:** [December 5, 2007, 7:35pm UTC](https://forum.kirupa.com/t/how-to-scale-a-movieclip-proportionately-with-onresize/245950 "2007-12-05T19:35:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeydigital](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@joeydigital](https://forum.kirupa.com/u/joeydigital)\
**Post date:** [December 5, 2007, 7:35pm UTC](https://forum.kirupa.com/t/how-to-scale-a-movieclip-proportionately-with-onresize/245950/1 "2007-12-05T19:35:51Z")

</div>

I’m trying to figure out how to SCALE a movieClip proportionately when the user resizes the browser window.

I was able to successfully scale the background to fill the browser window, but that was easy since there was no math involved…

I don’t want to use \_width / \_height because when I create the movieClip container, I had to scale it down to 85 (since the swf’s that I’m loading are larger than I want them to be), so I want to use \_xscale / \_yscale, if possible…

Here’s the code snippet:

//scale parent container  
container\_mc.\_xscale = 85;  
container\_mc.\_yscale = 85;

…

//object to receive the screen events  
stageListener = new Object();  
//function for the event to listen for  
stageListener.onResize = function (){  
//resize stuff here

```
bg._xscale = Stage.width;
gradBG._xscale = Stage.width;

//container_mc._xscale = some formula;
//container_mc._yscale = some formula;

```

//assign a listener for the Stage object  
Stage.addListener(stageListener);  
Stage.scaleMode = “noScale”;

Any suggestions would be greatly appreciated - thanks in advance:)
