Sometimes it is required that your web page should validate, before displaying swf files, that whether flash plugin is installed on client computer or not. So try below code and enjoy:
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4) {
navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4) {
//Flash 4 or greater is available
} else {
//Flash 4 is not available
}