Click to See Complete Forum and Search --> : Flash Player Not Available - do something else?
jerryr125
04-18-2008, 01:24 PM
Hi !
This might go here or on the javascript board.
Does anyone have any code in which if the visitor to your site DOES not have
flash player, instead of showing the page with a big blank area you do something else ??
I dont know, perhaps something in javascript ?
Thanks - jerryr125
Eye for Video
04-22-2008, 08:39 AM
Using the SWFObject allows you to put in alternate content. That content can be an image or a message or whatever. It could also be an image (jpeg) of your Flash presentation along with a message saying that a Flash player is required. The image can contain links, just like a regular image. Get the SWFOject here:
http://www.adobe.com/devnet/flash/articles/swfobject.html
Here is an example of it used for Flash buttons. If the user does not have Flash, the alternate content still provides all the usability of my Flash buttons... just not as ...... Flashy..
http://www.lostmountainsurfcompany.com/index.html
View the source code for details on using alternate content.
Eye for Video
www.cidigitalmedia.com
calliepeck
06-09-2008, 08:29 AM
On that note, is there a way to disable flash so that you can test to see what it looks like for people without flash? I'm on a Mac, so Opera/Firefox/Safari fixes should work. I've seen things like FlashBlock, but that'll just throw a button up and presumably not show me what it really looks like.
Eye for Video
06-09-2008, 09:03 AM
If you choose to use SWFObject, the suggested method is to create and test all the alternate content first, making sure images show, links work, etc. Only after that’s working do you “turn on the Flash” so to speak. The simplest way to do that (for a developer anyway) is to turn off or disable the JavaScript that will be writing the flash content.
Here is the code pointing to the script that turns it on (in document <head>):
<script type="text/javascript" src="swfobject.js"></script>
Just comment this line out or don't place the script at that location during testing, and the Flash will never be seen. Here is the alternate content, an image and an anchor linking to other Web pages, same thing the Flash would do but not animated.
div id="about_us_btn" class="btn">
<a href="about_us.html"><img src="images/about_us_btn.jpg" alt="About Lost Mountain Surf Company" width="117" height="29" border="0"/></a>
</div>
You could also make the image a message saying Flash is required to view this content and then link that image to the Adobe download site.
Here is the JavaScript that will write the Flash, but only if that line showing path to swfobject is in the <head>.
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("about_us_btn.swf", "about_us_btn", "150", "30", "8", "#095bab");
so.write("about_us_btn");
// ]]>
</script>Hope this helps,
Eye for Video
www.cidigitalmedia.com
Tezcatlipoca
06-09-2008, 02:11 PM
You could also try the method I use for a couple of my pages.
You create a landing page which checks for flash (I use the index.html page), then directs the user to another page if found.
In the <HEAD> you use:
<script src="AC_OETags.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
var requiredMajorVersion = 8;
var requiredMinorVersion = 0;
var requiredRevision = 0;
</script>
and in the <BODY>:
<script language="JavaScript" type="text/javascript">
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if (hasReqestedVersion)
{
window.location="flashok.html";
}
else
{
var alternateContent = '<p align="center">This site requires Adobe Flash Player</p>'
+ '<p align="center"><a href=http://www.adobe.com/go/getflash/>Install Flash</a></p>';
document.write(alternateContent);
}
</script>
<noscript>
<meta http-equiv="refresh" content="0; url=noscriptpage.html">
</noscript>
This will scan for a minimum of the flash version listed in the HEAD (in green). If it finds it, the user is redirected to the page of your choice (in red text). It is also advisable to put in a redirection to a no script page (in blue text) to catch those visitors who have javascript turned off.
The javascript file mentioned in the HEAD section (in the purple text) is attached to this post.