×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can't seem to get proper Flash detection working

Can't seem to get proper Flash detection working

Can't seem to get proper Flash detection working

(OP)

I've tried the Macromedia Javascript. On a IE3 browser it STILL fetches the Flash plugin.

Thing is.. People who don't have flash do not need to download it to view the layout, for the HTML version looks almost the same..

I'd like to use a script which puts a .SWF in a placeholder when the flash Player is detected and a .JPG or .GIF when it isn't. No need for 'you can download flash here' buttons or something.

MASiR
masir@bigfoot.com

RE: Can't seem to get proper Flash detection working

It would be really complicated to display JPG and Flash depending on the plugin, you would need an ASP-enabled server and setup an index.html page to detect the plugin and then run the ASP in the server, then display the page according to the conditions. Do you know ASP?

Fortunately there is a better way, create one page with your Flash movie and then another one with the JPG.
In your index.html or welcome.html page add this code to the HEAD:

<script language=

Fernando Regueiro
ferhelping@yahoo.com

RE: Can't seem to get proper Flash detection working

It would be really complicated to display JPG and Flash depending on the plugin, you would need an ASP-enabled server and setup an index.html page to detect the plugin and then run the ASP in the server, then display the page according to the conditions. Do you know ASP?

Fortunately there is a better way, create one page with your Flash movie and then another one with the JPG.
In your index.html or welcome.html page add this code to the HEAD:

<script language="JavaScript">
<!--
function stopError(){
return true;
}

function checkPlugin(plgIn, theURL, oldURL, autoGo) {
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);
  else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=oldURL; if (theURL) window.location.replace(theURL);
}
window.onerror = stopError;
//-->
</script>


--

Then add this to your body tag:

onLoad="checkPlugin('Shockwave Flash','FLASHPAGE.html','NOFLASHPAGE.html',true);return document.MM_returnValue"



Replace FLASHPAGE and NOFLASHPAGE with your pages. This will redirect your page depending on the plugin.

I hope this helps

Fernando Regueiro
ferhelping@yahoo.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close