That'd do it...except that you need to define var ratio:Number =
_height/_width.

If var ratio:Number = _width/_height, then _width * ratio = (_width *
_width)/_height....That ain't right.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
| BLITZ
Sent: Thursday, March 29, 2007 9:42 AM
To: [email protected]
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.
_______________________________________________
[email protected]
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


_______________________________________________
[email protected]
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