You could probably optimize a little bit by removing the Math function...
mc._width = maxW;
mc._height = maxH;
if ( mc._xscale > mc._yscale ) {
mc._xscale = mc._yscale;
}
else {
mc._yscale = mc._xscale;
}
I don't think I can be done more effiently than that. Anyone?
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hans Wichman
Sent: 27 March 2007 16:06
To: [email protected]
Subject: Re: [Flashcoders] Image resizer that maintains ratio
ok, thanks joe for the explanation. Seems a lot of static / redundancy is
being generated by what you describe.
On 3/27/07, Joe Wheeler <[EMAIL PROTECTED]> wrote:
>
> I think the problem is the length of time it's taking for post to appear.
> Some of my posts have been going missing for a long time before
> showing up.
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Hans
> Wichman
> Sent: 27 March 2007 08:23
> To: [email protected]
> Subject: Re: [Flashcoders] Image resizer that maintains ratio
>
> The more I read these post, the more I wonder whether people actually
> read what others have already replied.
>
> On 3/26/07, Joe Wheeler <[EMAIL PROTECTED]> wrote:
> >
> > Here's how I do it:
> >
> > function maintainAspect ( mc:MovieClip, maxW:Number, maxH:Number )
> > :Void {
> > mc._width = maxW;
> > mc._height = maxH;
> > mc._xscale = mc._yscale = Math.min( mc._xscale, mc._yscale );
> > }
> >
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of
> > Guilherme Cruz
> > Sent: 26 March 2007 18:15
> > To: [email protected]
> > Subject: Re: [Flashcoders] Image resizer that maintains ratio
> >
> > The "_scale" property is a percentage value if you have a 800x600
> > image and set _xscale=50 and _yscale=50, you get a 400x300 image
> >
> >
> >
> >
> > On 3/26/07, Hans Wichman < [EMAIL PROTECTED]> wrote:
> > >
> > > Hi,
> > > that IS weird, because if your image is 800x600, you are saying:
> > > target_mc._xscale = target_mc._yscale = 800;
> > >
> > > which is probably not what you want^^
> > >
> > > greetz
> > > JC
> > >
> > >
> > > On 3/26/07, eric e. dolecki <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Ok that is SO weird. I was just thinking about this...
> > > >
> > > > myListener.onLoadInit = function( target_mc:MovieClip ):Void {
> > > > target_mc._xscale = target_mc._yscale = Math.max(
> > > > target_mc._width, target_mc._height ); };
> > > >
> > > > - Eric
> > > >
> > > >
> > > > On 3/26/07, Adrian Lynch <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Any examples out there?
> > > > >
> > > > > I've got as far as resizing a user supplied image and am about
> > > > > to work
> > > > on
> > > > > the ratio remaining fixed. Just thought I'd throw this out
> > > > > there as I think it may be tricky.
> > > > >
> > > > > Ta.
> > > > >
> > > > > Adrian
> > > > >
> > > > > _______________________________________________
> > > > > [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
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > eric e. dolecki
> > > > senior interactive engineer
> > > > http://www.ericd.net
> > > > _______________________________________________
> > > > [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
> > >
> > _______________________________________________
> > [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
> >
> _______________________________________________
> [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
>
_______________________________________________
[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