# Need Help - mc not sizing properly on load

**URL:** <https://forum.kirupa.com/t/need-help-mc-not-sizing-properly-on-load/170920>\
**Category:** flash\
**Created:** [November 30, 2005, 3:04pm UTC](https://forum.kirupa.com/t/need-help-mc-not-sizing-properly-on-load/170920 "2005-11-30T15:04:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayberz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jayberz/32/1949_2.png) [@Jayberz](https://forum.kirupa.com/u/Jayberz)\
**Post date:** [November 30, 2005, 3:04pm UTC](https://forum.kirupa.com/t/need-help-mc-not-sizing-properly-on-load/170920/1 "2005-11-30T15:04:31Z")

</div>

I have small application that allows the user to design their own sign.

One of the options is to load an animation from a combo box and preview it on the sign. The animation is loaded into a movie clip but does not constrain to the mc size when initially loaded.

If I click the button to create the sign (perform the drawSign function) the animations will load inside the mc to their constrained sizes.

I need to have this happen automatically as not to confuse the user.

\*\*Frame Code:  
\*\*

```auto
// C// Constants
stageWidth = 550;
stageHeight = 400;

// Functions
function drawSign(){
	mc_sign._width = width_txt.text*2;
	mc_sign._height = height_txt.text*2;
	message_txt.text = message_input_txt.text;
	message_txt._height = height_txt.text*2;
	message_txt._width = width_txt.text*2;
		
//Centers sign & message
	mc_sign._x = (stageWidth / 2) - (mc_sign._width / 2);
	mc_sign._y = (stageHeight / 2) - (mc_sign._height / 2);
	message_txt._x = (stageWidth / 2) - (message_txt._width / 2);
	message_txt._y = (stageHeight / 2) - (message_txt._height / 2);
	

}
import mx.controls.ComboBox;
import mx.transitions.Tween;
import mx.transitions.easing.*;
//create components in sence
createClassObject(ComboBox,"myCombo",this.getNextHighestDepth(),{_x:10,_y:10});
//init component and easing
myCombo.setSize(350);
myCombo.setStyle("openDuration",500);
//add comboBox item
links=new Array();
links.addItem({label:"Choose an Animation",data:""});
links.addItem({label:"July 4th",data:"july4.swf"});
links.addItem({label:"Thanksgiving",data:"thanksgiving.swf"});
//set listener
myListener=new Object();
myListener.change=function(){
 var holder=_root.mc_sign;
 holder.loadMovie(links[myCombo.selectedIndex].data);
}
myCombo.addEventListener("change",myListener);
myCombo.dataProvider=links;
// Main
drawSign();

```

Perform Function Button Code:

```auto
on(release){
	drawSign();
}

```

You can see a working example of the application here:  
[http://www.tlxcommercial.com/new/sign.html](http://www.tlxcommercial.com/new/sign.html)

My .fla is available here:  
[http://www.tlxcommercial.com/new/sign.fla](http://www.tlxcommercial.com/new/sign.fla)

Thanks for the help.
