View Full Version : Help scaling down a flash website to fit screen resolution ?
humbucker
February 15th, 2009, 08:25 AM
Hello,
I almost finished a website for a customer, it's a full flash website running at almost 1024/768px...BUT this guy still use a lower screen resolution and tell me I have to resize evertything down...meaning a lot lot people will find this website ridiculously little.
Is there a way to scale down a full flash and all of it's external swf loaded using I dunno javascript or anything else??
Many many thanks !!
scottc
February 15th, 2009, 08:44 AM
Shouldn't flash have scaling on by default?
stage.scaleMode = StageScaleMode.NO_SCALE; // or other scale modes...
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);
private function resizeHandler(e:Event):void{
trace(stage.stageWidth + "x" + stage.stageHeight);
}
And embed your flash to fit 100% of the width and height of the div.
theCodeBot
February 15th, 2009, 10:32 AM
Hello,
I almost finished a website for a customer, it's a full flash website running at almost 1024/768px...BUT this guy still use a lower screen resolution and tell me I have to resize evertything down...meaning a lot lot people will find this website ridiculously little.
Is there a way to scale down a full flash and all of it's external swf loaded using I dunno javascript or anything else??
Many many thanks !!
It's always a good idea to scale so that you do not upset people going from 1024x768 to 1280x1024 (the 2 most common resolutions), or even people with larger, widescreen resolutions like 1680x1050 (I have 2 of these side-by-side).
Obviously this project is the exception because your client runs 800x600, or god forbid, lower, but usually you shouldn't waste your time worrying about anything lower than 1024x768 (anything less is about 2% of web users now.)
humbucker
February 15th, 2009, 01:06 PM
Okaaaay thank you guys ! ;o)
This doesn't look really beautiful at some resolutions, especially at wide screen, so maybe you can tell me if there is a way to :
1) set the stage.Scale.SHOWALL (am I right?) when I'm lower than 1024*768
2) let the stage.NoScale when I'm equal 1024*768 or higher ?
I use a separate document class to pilot my flash if it can help...
Many thanks again.
theCodeBot
February 15th, 2009, 07:19 PM
When you load the page, you could have JS detect the screen size and set those.
scottc
February 16th, 2009, 04:29 AM
I'd rather avoid depending on javascript when flash can do it by itself, for example if the user manages to find the .swf and opens it directly in the browser, or even has javascript disabled. Also just detecting the user's resolution isnt good enough in my opinion, because what if they have extra toolbars installed, or they don't have the browser maximized... ie in a window the size of 732x564. The only that really matters would be the area that the flash content takes up, and you can detect that with flash regardless if the div is 500px or 100%.
To find the various scale modes and stage properties search live docs...
http://livedocs.adobe.com/flex/3/langref/flash/display/Stage.html#scaleMode
theCodeBot
February 16th, 2009, 08:28 AM
I'd rather avoid depending on javascript when flash can do it by itself, for example if the user manages to find the .swf and opens it directly in the browser, or even has javascript disabled. Also just detecting the user's resolution isnt good enough in my opinion, because what if they have extra toolbars installed, or they don't have the browser maximized... ie in a window the size of 732x564. The only that really matters would be the area that the flash content takes up, and you can detect that with flash regardless if the div is 500px or 100%.
To find the various scale modes and stage properties search live docs...
http://livedocs.adobe.com/flex/3/langref/flash/display/Stage.html#scaleMode
Regarding the infamous "Grandma checking her email has 200 toolbars installed, giving her 10% of her vertical screen space to browse the web" and people using non-maximized windows... Javascript's Screen.innerWidth and innerHeight (I believe that's how they were capitalized) read the dimensions of, well, the screen real estate left for the actual page, discounting toolbars, etc.
But yeah, scale mode would b a whole lot better XD I would set it to be show all mode, for the small screens, and when the screen sizes start to get big, you could set a maximum width and maximum height in CSS for the file's container.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.