In Q_22959568.html we resolved the problem of displaying "Click here to activate this control" when mouseover on a flash file
Now, I have this other problem
I have a second image, not a flash file which I want to display is flash is not detected in the browser.
For example, if flash is disabled or the user doesn't have flash installed, image1.gif should display otherwise image2.swf should display
The solution in question Q_22959568.html was sufficient to resolve the mouseover problem(please refer to it for more info)
I have the following on the page that's suppose to display the flash OR image if flash is not installed
<p align=right>
<script LANGUAGE="JavaScript">
var ShockExist = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
if (navigator.plugins && navigator.plugins["Shockwave Flash"])
ShockExist = 1;
} if (ShockExist ) {
<script src='flash.js' type='text/javascript'></script>
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0))
{
<script src='flash1.js' type='text/javascript'></script>
}
</p>
Where
flash.js is the file that has my flash image object
flash1.js is the file that has my normal image object and this suppose to display instead of flash image if flash plugin is not installed
I don't know if I am doing the right thing or there is a better way for this to work so any help or advise from the experts will be much appreciated
Thanks
Varvoura
Translating this into mock-javascript:
if(flash_present())
display_flash();
else
display_image();
That leaves the function flash_present() to be defined, something like this:
function flash_present() {
if(this_is_IE())
if(IE_got_flash())
return true;
if(this_is_Netscape())
if(Netscape_got_flash())
return true;
return false;
}
You can define the other functions yourself, my knowledge of finding out if flash is present is... er... limited... ;-))