function(target_mc){
var tWidth = 0;
var tHeight = 0;
var SW = Stage.width;
var SH = Stage.height;
if (target_mc._width<=SW && target_mc._height<=SH) {
tWidth = target_mc._width;
tHeight = target_mc._height;
} else {
var w = target_mc._width/SW;
var h = target_mc._height/SH;
if (w>h) {
tWidth = SW;
tHeight = ((w>=1) ? Math.round(target_mc._height/w) : Math.round(target_mc._height*w));
} else if (w<h) {
tHeight = SH;
tWidth = ((h>=1) ? Math.round(target_mc._width/h) : Math.round(target_mc._width*h));
} else {
tWidth = SW;
tHeight = SH;
}
}
target_mc._width = tWidth;
target_mc._height = tHeight;
};
}