ulfben icon

FlashGallery scaling routine

ulfben | PRO | 07/18/11 05:38:45 PM UTC | -1 ⭐ | 11123 👁️ | Never ⏰ | []
ActionScript |

800 B

|

None

|

0 👍

/

1 👎

//TODO: missbehaves on rectangular images?
//http://wordpress.org/support/topic/square-images-cropped-in-fullscreen?replies=7#post-2227942
function fitToScreen(mc:MovieClip) {    
    var maxHeight:Number = Stage.height-25;
    ZigoEngine.doTween (mc,"_x",0,0,"linear",0,function () {    
    if(mc._height <= maxHeight && mc._width <= Stage.width){            
        mc._yscale = mc._xscale = 100;      
    }
    if(_scalingStrategy != _NOSCALE){
        if(mc._height < mc._width) {
            mc._width = Stage.width;        
            mc._yscale = mc._xscale;
            if(_scalingStrategy == _FILL){
                if (mc._height < maxHeight) {
                    mc._height = maxHeight;
                    mc._xscale = mc._yscale;
                }
            }
        }else {
            mc._height = maxHeight;
            mc._xscale = mc._yscale;        
        }   
    }
    mc._x = Stage.width/2 - mc._width/2;
    mc._y = maxHeight/2 - mc._height/2;
    });
}

Comments

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

    0 B

    |

    👍

    /

    👎

    
        
  • Asithaza icon
    04/02/26 04:17:18 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

    |

    👍

    /

    👎