|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
#1
|
|||
|
|||
|
hello please help me. i cant find this anywhere and dont know if its possible. i need to redirect users to different pages on my websites based on the aspect ratio of their resolution. i am using flash for my sites which will max out at 100% of width and height. so, i want to redirect to the version of the page that will best suit them, with 2 different versions based on 4:3 and 16:9, so that when they click the full screen button on my flash, it will fill their monitor fully. i could do this with the regular Screen Size Redirect Scripthttp://www.dynamicdrive.com/dynamicindex9/info3.htm , but i would have to input so many different screen resolutions just to make sure i am covered. i would like to just have a function that takes screen.width divided by screen.height and compares it to my ratios of being > < = 4:3 or 16:9
thanks |
|
#2
|
||||
|
||||
|
Why don't you just do it all in Flash?
stage.height and width will return a value, based on that value you can load movie1 or movie 2. Seems a little easier than all that you said. OR, you could just make 2 links, one for each aspect ratio. Let the user click on the one they want.
__________________
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team} Follow Me on Twitter: @Negative_Chaos PHP Code:
|
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
||||
|
||||
|
So right now you have 2 swf files yes? one for 4:3 and one for 16:9, correct?
And you want something that will find the aspect ratio of the users computer, and based on that match them with the correct swf for them to view? If that is correct, then tell me the following: 1) Names of the 2 Flash files you are using. 2) Version of Flash you are using (7, 8, 9or MX, MX 2004, CS3) 3) When you need it by
__________________
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team} Follow Me on Twitter: @Negative_Chaos PHP Code:
|
|
#5
|
|||
|
|||
|
Quote:
and yes i do want to detect the aspect ratio so that they are matched with the correct swf. 1)futurama4x3.swf, futurama16x9.swf (generic examples of names) 2) CS3 3) no real due date, this is just for fun i tried to edit that screen redirect script, but i really am not sure about the language. my code below didnt work, but i really didnt expect it to: <script language="JavaScript1.2"> if (screen.height/screen.width<.75) //if <4:3 window.location.replace("http://www.example.com/page1.htm") else if (screen.height/screen.width>.75) //if >4:3 window.location.replace("http://www.example.com/page2.htm") else if (screen.height/screen.width=.75) //if =4:3 window.location.replace("http://www.example.com/page3.htm") </script> |
|
#6
|
||||
|
||||
|
We will just do it all internally in Flash (Easy, don't freak out
)I will match your devices, but it will have to wait, as I don't run CS3 at work. When I get home I will work on a couple of examples for you. Hopefully with luck, I can just provide you with a little piece of AS to place on the "full screen" button you have: Quote:
__________________
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team} Follow Me on Twitter: @Negative_Chaos PHP Code:
|
|
#7
|
|||
|
|||
|
the full screen button is part of the SlideShowPro component, i am not sure if that can be edited. is there any way to have that javascript do a redirect based on the math of width divided by height, or is that out of the scope of what javascript can do? and why the hell are you working on a sunday? watch some cartoons
Last edited by kevin186; 12-30-2007 at 07:49 PM. |
|
#8
|
||||
|
||||
|
well, you could try something like the following:
Code:
var e=(screen.width/screen.height);
if (e=1.66){
window.location.replace("http://www.example.com/page2.htm");
else{
window.location.replace("http://www.example.com/");
}
Just make sure the JS is correct, as I am not much help on JS yet. (But I am learning it)
__________________
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team} Follow Me on Twitter: @Negative_Chaos PHP Code:
|
|
#9
|
||||
|
||||
|
Your reasoning makes sense, but there's a flaw.
Not everyone, in fact it may be rare that anyone has the browser maximized. So any screen, regardless of dimension may be any width or height, within the maximum dimensions of the monitor. There are not simply 16:9 and 4:3 monitors, but, then, any aspect ratio of windows. You would be best off, probably, running it as a choice, or perhaps with an autodetect within flash, to guess which is closest. Really though I'd just pick one and let people deal with it. If someone had a widescreen monitor, pillarboxing won't be all that stunning. And if you are making something intended to feel like a film, well, go widescreen, and letterbox for the 4:3 monitors and they'll not only be accepting of it, but most people will probably think it's cool, that "film look". Blizzard, those do seem about accurate for common ratios, though it's futile to try and list them all because they vary, especially from country to country.
__________________
Daniel - Freelance Web Design | <?php?> | <html>| Ich kann Deutsch. | Capisco l'italiano. | Estudio español. | Estudava português. | un peu de français | 日本語の学生です。| درست العربية |
|
#10
|
||||
|
||||
|
True. Another option would be instead of finding aspect ratio find the view point (browser window size) and based on that use >= or <= to go to the desired movie.
Code:
<script type="text/javascript">
<!--
var viewportwidth;
var viewportheight;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined')
{
viewportwidth = window.innerWidth,
viewportheight = window.innerHeight
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0)
{
viewportwidth = document.documentElement.clientWidth,
viewportheight = document.documentElement.clientHeight
}
// older versions of IE
else
{
viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
viewportheight = document.getElementsByTagName('body')[0].clientHeight
}
document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
//-->
</script>
__________________
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team} Follow Me on Twitter: @Negative_Chaos PHP Code:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|