ulfben icon

FlashGallery scaling fixed

ulfben | PRO | 12/27/11 11:08:16 PM UTC | 0 ⭐ | 10983 👁️ | Never ⏰ | []
ActionScript |

890 B

|

None

|

0 👍

/

0 👎

//Finally came around to rewrite this: http://pastebin.com/tvnz57eQ
//fixing _FIT of near-rectangular pictures & _FILL-behaviour (filling on both axis)
function fitToScreen(mc:MovieClip) {    
    mc._yscale = mc._xscale = 100;
    var maxHeight:Number = Stage.height-25; 
    if(_scalingStrategy == _FIT){
        var getWidthRatio:Number = mc._width / mc._height;
        var getHeightRatio:Number = mc._height / mc._width;         
        if(Stage.width > maxHeight){
            mc._height = maxHeight;
            mc._width = Math.round(maxHeight*getWidthRatio);
        }else{
            mc._width = Stage.width;
            mc._height = Math.round(Stage.width*getHeightRatio);
        }   
    }else if(_scalingStrategy == _FILL){
        mc._width = Stage.width;        
        mc._yscale = mc._xscale;                
        if(mc._height < maxHeight){
            mc._height = maxHeight;
            mc._xscale = mc._yscale;
        }
    }
    mc._x = Stage.width*0.5 - mc._width*0.5;
    mc._y = maxHeight*0.5 - mc._height*0.5;
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Rteuixl icon
    04/02/26 04:26:55 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎