I found some code online which I turned into a function... This should give you the scale whether you are scaling up or down. You tell it the area you want your mc to fit into and it will give you a number back...all you have to do is then use that number...example: mc._xscale = mc._yscale = number_returned_from_function.

Maybe this helps out a bit?

function fitToDimension( sourceWidth:Number, sourceHeight:Number, targetWidth:Number, targetHeight:Number ):Number {

                if ( sourceWidth/targetWidth > sourceHeight/targetHeight ) {
                        //aspect ratio is determined by width
                        return (targetWidth*100/sourceWidth);
                } else {
                        //aspect ratio is determined by height
                        return (targetHeight*100/sourceHeight);
                }
                
        }

-James



On Mar 28, 2007, at 10:28 AM, {reduxdj} wrote:

I know how to scale an image down... what's the formula for scaling up too?

For instance, i want my images to be in proportion and at least 500 pixels wide.

Thanks,
Patrick

_______________________________________________
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