# Proportionate resize based on bounds

**URL:** https://forum.kirupa.com/t/proportionate-resize-based-on-bounds/152457
**Category:** Uncategorized
**Created:** [June 24, 2005, 11:42pm UTC](https://forum.kirupa.com/t/proportionate-resize-based-on-bounds/152457 "2005-06-24T23:42:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shuga](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@shuga](https://forum.kirupa.com/u/shuga)
#### Post date: [June 24, 2005, 11:42pm UTC](https://forum.kirupa.com/t/proportionate-resize-based-on-bounds/152457/1 "2005-06-24T23:42:51Z")

</div>

i have a container that is 100 x 100 and i have various symbols of different shapes and sizes (states for a U.S. map) that i am loading into that box and need to resize

some are bigger, some are smaller

can anyone help me figure out how to scale them proportionately larger or smaller depending on their size relative to the container.

here’s what i have so far

```auto

attachMovie(_root.curState, "curState", 100, {_x:25, _y:15});
widthBound = 100;
heightBound = 100;
if (curState._width<widthBound && curState._height<heightBound) {
	ratioWidth = Math.round(widthBound/curState._width);
	ratioHeight = Math.round(heightBound/curState._height);
	if (ratioWidth>ratioHeight) {
		curState._width *= ratioWidth;
		curState._height *= ratioHeight;
	}
}

```
