Why would you do that, though?  You're adding an extra calculation for
no reason.  It's inefficient and unnecessary.

And I'm not setting _height to _width divided by ratio, but _width TIMES
ratio.


 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Steve Abaffy
> Sent: Thursday, March 29, 2007 11:46 AM
> To: flashcoders@chattyfig.figleaf.com
> Subject: RE: [Flashcoders] Scaling Up an Image in Proportion 
> to width or height
> 
> Yes but you could do it like this
> 
> You resize the _width:
> _width = Math.max(newWidth, 500);
> You set _height to the _width * ratio:
> _height = _width * (1/ratio);
> Which is the same thing as
> _height = _width / ratio;
> 
> 
> 
> This would be (_width/_height * _height) this cancels the 
> _height leaving
> you with just _width.
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Hershell
> Bryant
> Sent: Thursday, March 29, 2007 1:58 PM
> To: flashcoders@chattyfig.figleaf.com
> Subject: RE: [Flashcoders] Scaling Up an Image in Proportion 
> to width or
> height
> 
> 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: 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
> 
> 
> 
> _______________________________________________
> 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