You also need to use MovieClipLoader and onLoadInit before measuring
the size of the clip. Just testing it for _width>4 (per your earlier
example) will return an immediate positive if there was an image
already loaded prior to calling loadMovie.
-Marc
At 11:50 AM 11/1/2006, you wrote:
It addresses half the problem. I missed the other requirement.
It's pretty easy to accomplish that, though.
You find the largest dimension delta and determine its percentage delta
and then adjust based on that.
var perc:Number;
if (actualW - targetW > actualH - targetH) {
perc = targetW / actualW;
} else {
perc = targetH / actualH;
}
clip._xscale = clip._yscale = perc * 100;
_______________________________________________
[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