gavin26er Posted December 1, 2005 Share Posted December 1, 2005 hi guysgot another problem i got this javascript code off of bathurst guy it does what i want it do, but there are a few problems.1. is that there is a little dead space under the picture, if the swf fails to display in the table.2. is now it don't prompt you and ask you if you want to download flash anymore. i want it to prompt me and if you say don't apply it displays the default pic and.below is the javascript that have and i have attached my files if you want to take a look thanks<script type="text/javascript"><!--var flashInstalled = false;var isIE = (navigator.userAgent.indexOf("MSIE") != -1) ? true : false; var isWin = (navigator.userAgent.indexOf("Win") != -1) ? true : false;if (navigator.plugins && navigator.plugins.length){var x = navigator.plugins["Shockwave Flash"];if (x){if (x.description){y = x.description;var flashVersion = y.charAt(y.indexOf('.')-1); //checks flash versionif (flashVersion>=6){ //checks for version 6 and above.flashInstalled = true;}}}}if(isIE && isWin){ //can't read from plugins array on ie pc...document.write('<scr' + 'ipt language=VBScript> \n');document.write('on error resume next \n');document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n'); document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n'); document.write('<\/scr' + 'ipt> \n');}if (flashInstalled){document.write ('<object type="application/x-shockwave-flash" data="Untitled-1.swf" width="760" height="120">');document.write ('<param name="movie" value="Untitled-1.swf" width="760" height="120" quality="high" menu="false" />');document.write ('<\/object>');}else {document.write ('<img src="Untitled-1.jpg" width="760" height="120"/>');}//--></script>gavin Link to comment Share on other sites More sharing options...
Chocolate570 Posted December 1, 2005 Share Posted December 1, 2005 This should do the prompting, but I'm sorry to say I can't help you at all with your first question. I don't understand. <script type="text/javascript"><!--var flashInstalled = false;var isIE = (navigator.userAgent.indexOf("MSIE") != -1) ? true : false;var isWin = (navigator.userAgent.indexOf("Win") != -1) ? true : false;if (navigator.plugins && navigator.plugins.length){var x = navigator.plugins["Shockwave Flash"];if (x){if (x.description){y = x.description;var flashVersion = y.charAt(y.indexOf('.')-1); //checks flash versionif (flashVersion>=6){ //checks for version 6 and above.flashInstalled = true;}}}}if(isIE && isWin){ //can't read from plugins array on ie pc...document.write('<scr' + 'ipt language=VBScript> \n');document.write('on error resume next \n');document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');document.write('<\/scr' + 'ipt> \n');}if (flashInstalled){if (confirm("Are you sure you want to download this movie?")){document.write ('<object type="application/x-shockwave-flash" data="Untitled-1.swf" width="760" height="120">');document.write ('<param name="movie" value="Untitled-1.swf" width="760" height="120" quality="high" menu="false" />');document.write ('<\/object>');}}else {document.write ('<img src="Untitled-1.jpg" width="760" height="120"/>');}</script> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now