This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Flash Site Design > April 2004 > Auto-Resolution
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Doctor Wink 2004-04-27, 4:30 am |
| I'm wondering if anyone knows how to make it so when someone goes to your site
that it will automaticly resize itsself to the resolution of the viewers
computer. (Not talking bout 100% by 100%) any answers are deeply appreciated.
Not sure if it's possible though....
| |
| Clukey 2004-04-27, 4:30 am |
| If you don't mean 100% by 100%, then what exactly do you mean?
| |
| rlragona 2004-04-27, 4:30 am |
| I suppose you could embed your flash in html, which I assume you are, and use
the availWidth code, or something of the like, but 100% does relate to the
viewer's computer. If you used availWidth for the main page in conjunction with
a % (whether it be 100% or 5% or anything inbetween) it should do the trick for
you.
| |
| privatenews.microsoft.com 2004-04-27, 7:28 am |
| Not sure exactly what you mean, i'm assuming you would like the browser
window to open full screen, then you would do this in HTML before the flash
movie is embeded at 100%
If you use style sheets you can set the browser to open at 100% of screen
size.
You can achieve this in IE here...
http://support.microsoft.com/defaul...&NoWebContent=1
heres a sample of code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">
window.onload = maxWindow;
function maxWindow()
{
window.moveTo(0,0);
if (document.all)
{
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if
(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.ava
ilWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>
</head>
<BODY topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"
bgcolor="#000000">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=6,0,29,0" width="100%" height="100%">
<param name="movie" value="your flash movie.swf">
<param name=quality value=high>
<embed src="Main%20Page.swf" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_
Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%"
height="100%"></embed>
</object>
</body>
</html>
// just replace "your flash movie.swf" with the reletive path and name of
the movie file.
"Doctor Wink" <webforumsuser@macromedia.com> wrote in message
news:c6kdpc$bhs$1@forums.macromedia.com...
> I'm wondering if anyone knows how to make it so when someone goes to your
site
> that it will automaticly resize itsself to the resolution of the viewers
> computer. (Not talking bout 100% by 100%) any answers are deeply
appreciated.
> Not sure if it's possible though....
>
| |
| privatenews.microsoft.com 2004-04-27, 7:28 am |
| NB...
also replace Main%20Page.swf with your values.
"privatenews.microsoft.com" <ruffup@msn.com> wrote in message
news:c6lc6m$hq1$3@forums.macromedia.com...
> Not sure exactly what you mean, i'm assuming you would like the browser
> window to open full screen, then you would do this in HTML before the
flash
> movie is embeded at 100%
>
> If you use style sheets you can set the browser to open at 100% of screen
> size.
>
> You can achieve this in IE here...
>
>
http://support.microsoft.com/defaul...&NoWebContent=1
>
>
> heres a sample of code:
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <script language="JavaScript">
> window.onload = maxWindow;
>
> function maxWindow()
> {
> window.moveTo(0,0);
>
>
> if (document.all)
> {
> top.window.resizeTo(screen.availWidth,screen.availHeight);
> }
>
> else if (document.layers||document.getElementById)
> {
> if
>
(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.ava
> ilWidth)
> {
> top.window.outerHeight = screen.availHeight;
> top.window.outerWidth = screen.availWidth;
> }
> }
> }
>
> </script>
>
> </head>
> <BODY topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"
> bgcolor="#000000">
> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
>
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
> b#version=6,0,29,0" width="100%" height="100%">
> <param name="movie" value="your flash movie.swf">
> <param name=quality value=high>
> <embed src="Main%20Page.swf" quality=high
>
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_
> Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%"
> height="100%"></embed>
> </object>
> </body>
> </html>
>
> // just replace "your flash movie.swf" with the reletive path and name of
> the movie file.
>
> "Doctor Wink" <webforumsuser@macromedia.com> wrote in message
> news:c6kdpc$bhs$1@forums.macromedia.com...
your[color=darkred]
> site
> appreciated.
>
>
| |
|
| <SCRIPT LANGUAGE="Javascript">
<!--
// window_size_table and screen_size_table - These two arrays provide a
// translation between screen size and desired window size. For instance,
// if the screen is 800x600 and the desired window size is 720x405, the
// first two elements in screen_size_table should be 800 and 600 while the
// first two elements in window_size_table should be 720 and 405. There
// can be as many sizes as needed, as long as the numbers are given in
// pairs.
var screen_size_table = new Array(800, 600,
1024, 768,
1152, 864,
1280, 1024);
var window_size_table = new Array(720, 405,
960, 540,
1088, 612,
1200, 675);
// default_width_percent - This setting is only used if the screen size cannot
// be matched in screen_size_table. This is the percent of the screen width
// that the popped-up window should occupy, expressed as a whole number. For
// example, if the popped-up window should be 83% as wide as the screen, set
// default_width_percent to 83. NOTE: Proportionality is YOUR problem.
var default_width_percent = 75;
// default_height_percent - This setting is only used if the screen size cannot
// be matched in screen_size_table. This is the percent of the screen height
// that the popped-up window should occupy, expressed as a whole number. For
// example, if the popped-up window should be 34% as tall as the screen, set
// default_height_percent to 34. NOTE: Proportionality is YOUR problem.
var default_height_percent = 75;
// target_html_page - The URL that the popped-up window should contain. This
// may be relative. NOTE: This page must be on the same site as the current
// page or the window.moveTo() command will cause a Javascript error in
// Internet Explorer.
var target_html_page = "index2.html";
// target_window_name - The name of the popped-up window. This isn't
// important unless the popped-up window needs to be further manipulated
// with Javascript.
var target_window_name = "lookandfeel";
// =====================================================================
// DO NOT CHANGE ANYTHING BELOW THIS LINE.
// =====================================================================
function open_window()
{
var i;
var window_width;
var window_height;
var window_top;
var window_left;
if (window.screen.availHeight)
{
window_height = window.screen.availHeight * (default_height_percent / 100);
window_width = window.screen.availWidth * (default_width_percent / 100);
}
for (i = 0; i < screen_size_table.length; i += 2)
if ((screen_size_table[i] == window.screen.width) &&
(screen_size_table[i + 1] == window.screen.height))
{
window_width = window_size_table[i];
window_height = window_size_table[i + 1];
break;
}
if (window.screen.availHeight && (window.screen.availTop == 0))
{
window_top = ((window.screen.availHeight / 2) + window.screen.availTop) - (window_height / 2);
window_left = ((window.screen.availWidth / 2) + window.screen.availLeft) - (window_width / 2);
}
else if (window.screen.availHeight)
{
window_top = (window.screen.availHeight / 2) - (window_height / 2);
window_left = (window.screen.availWidth / 2) - (window_width / 2);
}
else
{
window_top = 0;
window_left = 0;
}
window.open(target_html_page, target_window_name, "screenX=" + window_left + ",screenY=" + window_top + ",height=" + window_height + ",width=" + window_width + ",hotkeys=no,directories=no,menubar=no,location=no,personalbar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no").moveTo(window_left, window_top);
return(false);
}
//-->
</SCRIPT>
--
Al Winchell
www.Amazingwebs.com
den.tigersquadron.com
| |
| Doctor Wink 2004-04-28, 10:30 pm |
| awsome feedback, but what i mean is NOT 100% by 100% because that is 100% of
the window size, like when you make window smaller it shrinks. i wont it so if
they had 800x600, the flash size would be 800x600 and not change. is that all
what all that code does?
| |
| privatenews.microsoft.com 2004-04-29, 10:33 pm |
| I tell a lie, look at www.sw-iba.org.uk (scuse the scummy site lol its a
filler till they get their finger out with what they want and pay) lmao!
"privatenews.microsoft.com" <ruffup@msn.com> wrote in message
news:c6qvju$pbh$1@forums.macromedia.com...
> Hi,
>
> My solution is implemented in www.whitsandbaydivers.com , try resizing the
> window and then refreshing the page!
>
> J
>
> "Doctor Wink" <webforumsuser@macromedia.com> wrote in message
> news:c6pfr5$r4t$1@forums.macromedia.com...
100%[color=darkred]
> of
> so if
that[color=darkred]
> all
>
>
| |
| privatenews.microsoft.com 2004-04-29, 10:33 pm |
| Hi,
My solution is implemented in www.whitsandbaydivers.com , try resizing the
window and then refreshing the page!
J
"Doctor Wink" <webforumsuser@macromedia.com> wrote in message
news:c6pfr5$r4t$1@forums.macromedia.com...
> awsome feedback, but what i mean is NOT 100% by 100% because that is 100%
of
> the window size, like when you make window smaller it shrinks. i wont it
so if
> they had 800x600, the flash size would be 800x600 and not change. is that
all
> what all that code does?
>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|