Or, if it's a movieclip you're working with you can simply:

Scale the width..

_width = 500

And then set the height using the scale property

_yscale = _xscale

Works up and down

j
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
| BLITZ
Sent: 29 March 2007 18:42
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] Scaling Up an Image in Proportion to width or
height

Simple.

You solve for the ratio:

var ratio:Number = _width / _height;


You resize the _width:

_width = Math.max(newWidth, 500);


You set _height to the _width * ratio:

_height = _width * ratio;


fin.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to