PDA

View Full Version : Enlarge .swf in HTML up to a certain point..???


hoppl
12-09-2005, 02:22 PM
Hi, I'm trying to accomplish something here.

Basically, what I'd like is to have my swf site, shrink in the browser if there isn't enough space (like on a 15inch screen, for example..).

But if the user has a better resolution, have the swf enlarge up to a certain point, like 120% of the original Flash dimension... So, the swf would stop enlarging at 120%, if there is more space, it would sit there in the middle of the browser...

What I want is not to have the site full screen on huge 19 and 21 inch screen (have it at 120% max for example), but to have it 100% (shrink if to big) in smaller browser windows...

Hope you can understand.... Thanks...

farafiro
12-11-2005, 03:49 AM
I've made this sometime ago// determin the movie width and height
mcWidth = 400
mcHeight = 400
//making the listener object that the stage will listen to
resizeListener = new Object()
resizeListener.onResize = function(){
Stage.align = "C"
//script for detecting if the stage resized and re-arrange the stage
if(Stage.height<mcHeight || Stage.width<mcWidth){
Stage.align = "TL"
_root._xscale =_root._yscale = Math.min(Stage.width,Stage.height)/400*100
}
}
//make the stage listens to our listner
Stage.addListener(resizeListener)