Posted By

xactoknife on 08/07/11


Tagged

scale DisplayObject


Versions (?)

Scaling a DisplayObject to fit to a container’s dimensions


 / Published in: ActionScript 3
 

  1. var scale:Number = ((container.height/container.width) > (image.height/image.width)) ? (container.width/image.width) : (container.height/image.height);
  2. image.scaleX = scale;
  3. image.scaleY = scale;

Report this snippet  

You need to login to post a comment.