# Help Proportional scaling MovieClips relative to stage

**URL:** <https://forum.kirupa.com/t/help-proportional-scaling-movieclips-relative-to-stage/280680>\
**Category:** flash\
**Created:** [January 30, 2009, 10:31am UTC](https://forum.kirupa.com/t/help-proportional-scaling-movieclips-relative-to-stage/280680 "2009-01-30T10:31:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terraform](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Terraform](https://forum.kirupa.com/u/Terraform)\
**Post date:** [January 30, 2009, 10:31am UTC](https://forum.kirupa.com/t/help-proportional-scaling-movieclips-relative-to-stage/280680/1 "2009-01-30T10:31:32Z")

</div>

Hello  
I need some assistance on how to proportionally scale multiple movieClips relative to the stage size.

I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally)

But

I can not figure out for the life of me how to scale other movieclips in relation  
to the stage size.

for example I have a background\_mc that proportionally scales with the stage  
to fill without distortion.

HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion?

Ideally I would like to place several MC’s on my stage all scaling in proportion with the stage yet independently.

I have not been able to find any documentation on this.  
lots of tutorials on backgrounds and color fills and the like but nothing  
on proportional scaling of independent mc’s

this is the code I use for my background\_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)

```auto

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);

//function to handle background image resize.
function setBackground() {
	var reg2 = stage.stageWidth / 2;
	var reg1 = stage.stageHeight / 2;
	bg_mc.x = reg2;
	bg_mc.y = reg1;
	bg_mc.width = stage.stageWidth;
	bg_mc.height = stage.stageHeight;
	bg_mc.scaleX <= bg_mc.scaleY ? (bg_mc.scaleX = bg_mc.scaleY) : (bg_mc.scaleY = bg_mc.scaleX);
	
}
setBackground();

function resizeHandler(event:Event):void {
	setBackground();

```

thanks
