- Browser supports the required version of Flash
- Excellent. This is the ideal situation. Your Flash-based content will be displayed as intended.
- Browser supports Flash, but has not upgraded to the required version
- Worst case. Even so, all hope is not lost. In this situation, visitors will see either animated gif content, or static image content.
The central component of this method is skyzyx.com’s all-purpose Flash-detection script, Flash Detect 3 (404 link removed 2016/03/24). Check out, read up, download, install, and link via:
body> of your (X)HTML webpage. Here is the general structure of the code we will be using:
Okay, let’s have a look at the code. First, the function checks for the current version of Flash (currently v.8). If your Flash movie requires a different version, change the value "8" in the first "
if" statement and also in the the first instance of the <
object> tag (it appears in the URL string for the
codebase attribute). You will also want to configure the remainder of this first
if statement with additional parameters and attributes according to your specific requirements. Also, don’t forget to edit the movie path in both
Next, if the function fails to detect the first specified version of Flash (i.e., 8), it will check for the version specified in the second, "
if else" statement (version 7 in our example). As with the initial
if else" statement.
The process of detecting variously indicated versions of Flash will continue through each subsequent "
if else" statement until the requirements are met. To add alternate-content support for additional versions of Flash, simply extrapolate the pattern of "
if" statements ad infinitum. Otherwise, delete the text that says "… (additional versions) …" (as well as the blank lines above and below) and continue on to the next paragraph.
After the function is finished checking for specific versions of Flash, it proceeds with an "
else if (flash.installed)" statement, which detects for the presence of Flash support in general by checking for any Flash version 4 or better. This enables you to provide some ancient Flash movie as a fallback for people with older versions installed. Simply edit the usual properties, add the required parameters, and edit the path to your Flash-version-3 movie. Otherwise, if you do not require such functionality, delete the entire "if else" statement.
document.write(). The choice is yours, but remember that the point of all of this is to provide alternate content to visitors that do not support the required version of Flash.
noscript> action, we provide for each of these cases such that:
..and here is the generalized <
<noscript> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"> ... <param name="movie" value="path/slideshow.swf" /> ... <embed src="http://domain.tld/path/to/slideshow.swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ... <img src="http://domain.tld/path/to/alt/image-01.jpg" alt="first alternate image served for non-Flash browsers" /> <img src="http://domain.tld/path/to/alt/image-02.jpg" alt="second alternate image served for non-Flash browsers" /> <img src="http://domain.tld/path/to/alt/image-03.jpg" alt="third alternate image served for non-Flash browsers" /> ... </object> </noscript>
<img src="http://domain.tld/path/to/alt/slideshow.gif" alt="alt gif content" />
The primary purpose of all this nonsense is to provide designers and developers with a method to help ensure universally synchronous multimedia content. This method is not restricted to Flash, but may be adapted rather easily to support additional media, such as QuickTime and other video formats. Further, this article is intended for reference purposes only. There may indeed be other, mutually effective methods for accomplishing similarly useful results. That’s all for now — God bless!
- 1 Codebase attribute info (404 link removed 2014/02/18)