Groups | Blog | Home
all groups > macromedia flash sitedesign > april 2007 >

macromedia flash sitedesign : How can I resize my Flash site to fit any screen resolution?



tlcarl
4/12/2007 1:12:26 AM
I built a 100% flash site with tiled framing but I have a problem. My flash was
built 766 x 750 pixiels. When viewed at resolutions greater than 1024x768 the
webpage looks great but anything less than that it looks like @#$@. I know most
people probably view at 1024 x 768. Is there anyway to auto resize based up on
screen resolution or something to detect the screen size and adjust the webpage
accordingly.

www.platlimosvc.com

Below is my html (index.html) for my flash movie:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" style="width:100%;
height:100%">
<tr>
<td valign="top" style="width:100%" height="750">
<table cellpadding="0" cellspacing="0" border="0" width="766"
style="height:100% " align="center">
<tr>
<td valign="top" width="234" style="height:750px ">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=6,0,29,0" width="766" height="750">
<param name="movie" value="flash/xxxx_main.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<!--[if !IE]> <-->
<object data="flash/xxxx_main.swf"
width="766" height="750" type="application/x-shockwave-flash">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
FAIL (the browser should render some flash content, not this).
</object>
<!--> <![endif]-->
</object>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" style="width:100%; height:1px; background-color:#6C6C6C">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%;
height:1px">
<tr>
<td valign="top" style="width:50%; height:1px"></td>
<td valign="top" style="width:766; height:1px">
<table cellpadding="0" cellspacing="0" border="0" width="766"
style="height:1px ">
<tr>
<td valign="top" width="766" style="height:1px "></td>
</tr>
</table>
</td>
<td valign="top" style="width:50%; height:1px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" style="width:100%; height:100%">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%;
height:100%">
<tr>
<td valign="top" style="width:50%; background:url(images/bottom-3.gif) top
right; height:100%"></td>
<td valign="top" style="width:766; background-image:url(images/bottom-5.gif);
height:100%">
<table cellpadding="0" cellspacing="0" border="0" width="766"
style="height:100% ">
<tr>
<td valign="top" width="766" style="height:100% "></td>
</tr>
</table>
</td>
<td valign="top" style="width:50%; background:url(images/bottom-4.gif) top
left; height:100%"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

David Stiller
4/13/2007 7:31:15 PM
tlcarl,

[quoted text, click to view]

You think so? Even if they have their resolution that high (which is
fairly standard, nowadays), do you think most people maximize their browsers
to fill that whole area?

[quoted text, click to view]

There is, indeed. :) Check out the Stage.onResize event in the
ActionScript 2.0 Language Reference. That event is dispatched when the
browser (or whatever container) is resized -- in cases where the SWF is
embedded with percentages. If that's your aim, you'll need to code against
that event, which can be done like this ...

http://www.quip.net/blog/2006/flash/how-to-position-movie-clips-browser-resizing

It can take a bit of thought, depending on the complexity of your goal,
but the result is usually worth it. The site in your URL is already built,
so this wouldn't do much of anything without opening the hood, so to speak,
and completely rebuilding the engine. A Flash movie has to be designed and
programmed to respond to the Stage.onResize event.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

zagods
4/21/2007 1:36:24 PM
I don't think you need action scripting. If it's 100% Flash, why not just drop
your SWF into your HTML document and set the properties @ 100%W & 100%H? Then
it will auto fit the window size whether it's not maximized or on different
resolution. Just make sure your Flash background colour is the same as the HTML.
ID. Awe
4/21/2007 7:23:55 PM
zagods
5/2/2007 6:56:15 PM
AddThis Social Bookmark Button