View Full Version : Need Urgent Help
2cool2
March 11th, 2002, 18:07
Hello!
I have a flash website.
Many people dont have flash :(
So i want a index.html page
which will redirect to flashindex.html if a person has flash installed
and htmlindex.html if he does not have flash
Thanks in Advance :)
wm2k1
March 11th, 2002, 18:17
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
var requiredVersion = 5;
var useRedirect = true;
var flashPage = "flash.html"
var noFlashPage = "home.html"
var upgradePage = "home.html"
var flash2Installed = false; // boolean. true if flash 2 is installed
var flash3Installed = false; // boolean. true if flash 3 is installed
var flash4Installed = false; // boolean. true if flash 4 is installed
var flash5Installed = false; // boolean. true if flash 5 is installed
var maxVersion = 5; // highest version we can actually detect
var actualVersion = 0; // version the user really has
var hasRightVersion = false; // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0; // the version of javascript supported
// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.1" TYPE="text/javascript">
<!--
// check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows
// this is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;
// write vbscript detection if we're not on mac.
if(isIE && isWin){ // don't write vbscript tags on anything but ie win
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}
// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
// next comes the standard javascript detection that uses the navigator.plugins array
// we pack the detector into a function so it loads before we run it
function detectFlash(){
if (navigator.plugins){ // does navigator.plugins exist?
if (navigator.plugins["Shockwave Flash 2.0"] // yes>> then is Flash 2
|| navigator.plugins["Shockwave Flash"]){ // or flash 3+ installed?
// set convenient references to flash 2 and the plugin description
var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
// a flash plugin-description looks like this: Shockwave Flash 4.0 r5
// so we can get the major version by grabbing the character before the period
// note that we don't bother with minor version detection. do that in your movie with $version
var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
// we know the version, now set appropriate version flags
flash2Installed = flashVersion == 2;
flash3Installed = flashVersion == 3;
flash4Installed = flashVersion == 4;
flash5Installed = flashVersion == 5;
}
}
// loop through all versions we're checking, and set actualVersion to highest detected version
for (var i = 2; i <= maxVersion; i++) {
if (eval("flash" + i + "Installed") == true) actualVersion = i;
}
// if we're on webtv, the version supported is 2 (pre-summer2000, or 3, post-summer2000)
// note that we don't bother sniffing varieties of webtv. you could if you were sadistic...
if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;
// uncomment next line to display flash version during testing
// alert("version detected: " + actualVersion);
// we're finished getting the version. time to take the appropriate action
if (actualVersion >= requiredVersion) { // user has a new enough version
hasRightVersion = true; // flag: it's okay to write out the object/embed tags later
if (useRedirect) { // if the redirection option is on, load the flash page
if(jsVersion > 1.0) { // need javascript1.1 to do location.replace
window.location.replace(flashPage); // use replace() so we don't break the back button
} else {
window.location = flashPage; // otherwise, use .location
}
}
} else { // user doesn't have a new enough version.
if (useRedirect) { // if the redirection option is on, load the appropriate alternate page
if(jsVersion > 1.0) { // need javascript1.1 to do location.replace
window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
} else {
window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
}
}
}
}
detectFlash(); // call our detector now that it's safely loaded.
// -->
</SCRIPT>
2cool2
March 11th, 2002, 18:27
so long :rolleyes:
meow
March 11th, 2002, 18:43
And what if they don't have javascript? Seems to me you have one page too many in that redirection suit. Use the redirection either on the flash page or the HTML page
But what's wrong with a plain old link to the html page? A lot of people that do have Flash installed would be grateful too.
Jan
March 11th, 2002, 19:02
Originally posted by meow
But what's wrong with a plain old link to the html page? A lot of people that do have Flash installed would be grateful too.
I wholeheartly agree, I don't have time to wait for flash introductions to load, so if there is a link to bypass it I use it. Most flash sites I will leave if they don't have that link.
2cool2
March 12th, 2002, 03:17
Originally posted by Jan
I wholeheartly agree, I don't have time to wait for flash introductions to load, so if there is a link to bypass it I use it. Most flash sites I will leave if they don't have that link.
My whole website is made in flash.
It is not a intro :mad:
meow
March 12th, 2002, 03:43
But you said you want to redirect them to a html page. What for if you don't have alternate content? To tell them "You don't have Flash installed and can't see my page"? :confused:
2cool2
March 12th, 2002, 03:49
Yes! Exactly!
That page will have this "This site uses Flash4 plugin or greater GET IT HERE. Its worth it!"
:)
Can some one help with the code m2k1 pasted :)?
Which part should i edit
Thanks in Advance :)
meow
March 12th, 2002, 03:59
Isn't it more convenient to have that display on the same page if the flash can't run? You use some <object><embed> mix I guess. Use <noembed> Place rude message here</noembed>.
:D
meow
March 12th, 2002, 04:02
Wait! I get it! You don't have the flash on a html page at all. You want to link directly to the .swf file? :o
In that case why not make it simple and have an intro page where hey can click to enter and are told they need flash?
2cool2
March 12th, 2002, 04:07
It is in HTML page
See http://www.oversee.net
If some one has flash it goes to http://www.oversee.net/oversee.htm
or else it goes to
http://www.oversee.net/installFlash.htm
telling to install flash :)
I want to do the same thing :)
Thanks in Advance :)
Jan
March 12th, 2002, 04:07
Where upon those that don't want it can leave your site :p
meow
March 12th, 2002, 04:20
I still think <noembed> is more elegant. But if that's what you want, why not steal theirs?
Seems like a DW script. Looks funny, but I guess it works. Those with js off won't be happy.
<SCRIPT LANGUAGE="JavaScript">
MM_FlashDispatch(
"oversee.htm",
"4.0",
true, // don't require latest rev. of plug-in
"installFlash.htm",
true, // don't install if user said no once
"installFlash.htm",
"installFlash.htm",
false
);
</SCRIPT>
Don't you know how to View Source? :D
Oops! Sorry, guess you need these too:
http://www.oversee.net/Dispatcher.vbs
http://www.oversee.net/Dispatcher.js
2cool2
March 12th, 2002, 04:36
Thats what i am using now, lol
I thought there was somethign better :confused2
is0lized
March 12th, 2002, 04:37
why dont you just have a intro page that says asks them to choose flash or html page?
2cool2
March 12th, 2002, 04:40
I only have a flash site :mad:
meow
March 12th, 2002, 04:47
Originally posted by 2cool2
Thats what i am using now, lol
I thought there was somethign better :confused2
:devious2: C'mon! You showed us that page as an example of what you want.
Jan
March 12th, 2002, 05:07
Originally posted by is0lized
why dont you just have a intro page that says asks them to choose flash or html page?
Cos all his site is flash :confused2
2cool2
March 12th, 2002, 05:27
Originally posted by meow
:devious2: C'mon! You showed us that page as an example of what you want.
I thought there was somethign better than that :confused2
meow
March 12th, 2002, 05:35
I'm sure there is. Something server side would be better but I don't know how to do it. Ask in the CGI forum next door.:p
Honestly, why don't you use the <noembed> and avoid fluky javascripts?
Aquatix
March 13th, 2002, 06:13
Make the index a html page. Insert the flash to fill 100% of the width and 90% of the height.
Use the bottom 10% for a link saying something like:
"Don't have flash?"
Link it to the flash download page.
To me, that makes sense. Tell me if I'm just being dumb! :o
- Aquatix :p
(BTW, don't you have a "non-flash" sister-site running along side? I usually don't bother using sites made TOTALLY from flash unless they load very quickly...)
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.