Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't seem to get proper Flash detection working

Status
Not open for further replies.

MASiR

Programmer
Jul 20, 2000
1
NL
<br>I've tried the Macromedia Javascript. On a IE3 browser it STILL fetches the Flash plugin.<br><br>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..<br><br>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. <p>MASiR<br><a href=mailto:masir@bigfoot.com>masir@bigfoot.com</a><br><a href= > </a><br>
 
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?<br><br>Fortunately there is a better way, create one page with your Flash movie and then another one with the JPG.<br>In your index.html or welcome.html page add this code to the HEAD:<br><br>&lt;script language= <p>Fernando Regueiro<br><a href=mailto:ferhelping@yahoo.com>ferhelping@yahoo.com</a><br><a href= > </a><br>
 
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?<br><br>Fortunately there is a better way, create one page with your Flash movie and then another one with the JPG.<br>In your index.html or welcome.html page add this code to the HEAD:<br><br>&lt;script language=&quot;JavaScript&quot;&gt;<br>&lt;!--<br>function stopError(){<br>return true;<br>}<br><br>function checkPlugin(plgIn, theURL, oldURL, autoGo) {<br>&nbsp;&nbsp;var ok=false; document.MM_returnValue = false;<br>&nbsp;&nbsp;with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);<br>&nbsp;&nbsp;else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1<br>&nbsp;&nbsp;&nbsp;&nbsp;if (plgIn.indexOf(&quot;Flash&quot;)!=-1 && window.MM_flash!=null) ok=window.MM_flash;<br>&nbsp;&nbsp;&nbsp;&nbsp;else if (plgIn.indexOf(&quot;Director&quot;)!=-1 && window.MM_dir!=null) ok=window.MM_dir;<br>&nbsp;&nbsp;&nbsp;&nbsp;else ok=autoGo; }<br>&nbsp;&nbsp;if (!ok) theURL=oldURL; if (theURL) window.location.replace(theURL);<br>}<br>window.onerror = stopError;<br>//--&gt;<br>&lt;/script&gt;<br><br><br>--<br><br>Then add this to your body tag:<br><br>onLoad=&quot;checkPlugin('Shockwave Flash','FLASHPAGE.html','NOFLASHPAGE.html',true);return document.MM_returnValue&quot;<br><br><br><br>Replace FLASHPAGE and NOFLASHPAGE with your pages. This will redirect your page depending on the plugin.<br><br>I hope this helps <p>Fernando Regueiro<br><a href=mailto:ferhelping@yahoo.com>ferhelping@yahoo.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top