Play flash and mpeg easily in your pages. function FPly(url,wt,ht){ url=url.toLowerCase(); if(url.indexOf('.swf')>0){ document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wt+'" height="'+ht+'" align="middle">'); document.write('<param name="movie" value="'+url+'" \/><param name="quality" value="high" \/><param name="menu" value="false">'); document.write('<embed src="'+url+'" quality="high" width="'+wt+'" height="'+ht+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" \/><\/object>'); } if(url.indexof('.wma')>0||url.indexof('.wmv')||url.indexof('.mp3')||url.indexof('.mpeg')){ document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+wt+'" height="'+ht+'"><param name="filename" value="'+url+'"/>'); document.write('<embed src="'+url+'" playcount="1" width="'+wt+'" height="'+ht+'"></embed></object>} if(url.indexof('.rm')>0){ document.write('<embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="'+url+'" controls="ControlPanel,StatusBar" width="'+wt+'" height="'+ht+'" autostart="true" loop="true"><\/embed>'); } } Code (markup): you can play some media(swf,mpeg,rm,rmvb,mp3,wmv) by using <script> FPly(banner.swf,468,60); FPly(shake.mpeg,400,300); </script>
thanks AoaoSo for the great share.... I always wondered how vbarcade coding is done... u just solved the mystery... it is the great one!
Good contribution. Also if you store the JS code in an external file and loading it into the HTML code would also in most cases get rid of the "Click this element to activate it" nasty message: <script type='text/javascript' src='loader.js'></script> // paste the FPly() function code in loader.js <script type='text/javascript'> FPly(banner.swf,468,60); FPly(shake.mpeg,400,300); </script> Code (markup): I'm using this technique successfully in serveral sites after spotting it in an Adobe Devpaper.