ProportionalScale

Adobe Flash/ActionScript 3.0 2011. 2. 24. 23:37
반응형
  private function ProportionalScale():void
  {
   var $sw:Number    = stage.stageWidth;
   var $sh:Number    = stage.stageHeight;
   var $scale:Number = 0;
  
   if (($sh / $sw) > (video.height / video.width))
   {
    $scale = video.width / video.height;
    video.height = $sh;
    video.width = $sh * $scale;
   } else {
    $scale =video.height / video.width;
      video.width =  $sw;
      video.height = $sw * $scale;
   }
   video.x = ($sw - video.width) / 2;
   video.y = ($sh - video.height) / 2;
  }
반응형

'Adobe Flash > ActionScript 3.0' 카테고리의 다른 글

SWC + FDT4 = SWF  (0) 2011.03.10
FlashDevelop + Molehill + Away3d_4.0.0  (0) 2011.03.10
draw custom round rect border  (0) 2011.02.22
What is an ArrayCollection?  (0) 2011.02.22
MovieClip의 center point 와 Scale변경  (0) 2011.02.02
: