I have a mc that is 357x394 that I am loading various images into...
these images are of various sizes but all are larger than the mc they
are being loaded into... I need to scale them down proportionally so the
whole image can be seen... how should I go about this so an image that
is 840x680
10, 2005 7:58 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Logic Help
I have a mc that is 357x394 that I am loading various images into...
these images are of various sizes but all are larger than the mc they
are being loaded into... I need to scale them down proportionally so the
whole
private function proportionalScale( who:MovieClip, mcHolder:MovieClip,
nDesiredWidth:Number, nDesiredHeight:Number ):Void {
var scaleBy:Number = Math.min(nDesiredWidth / who.width, nDesiredHeight
/who.height);
mcHolder._xscale = scaleBy;
mcHolder._yscale = scaleBy;
}
Maybe something like that?
3 matches
Mail list logo