Nice article by Mike Ilsley on “How to use CSS Sprites and Image Replacement”
Tag Archives: image
Resize an image with constrain proportions
function resizeThumb(mc:MovieClip, maxW:Number, maxH:Number = 0, constrainProportions:Boolean = true):void
{
maxH = maxH == 0 ? maxW:maxH;
mc.width = maxW;
mc.height = maxH;
if (constrainProportions)
{
mc.scaleX < mc.scaleY ? mc.scaleY = mc.scaleX:mc.scaleX = mc.scaleY;
}
}