Debt Consolidation - Debt Consolidation - Submit articles - Debt Consolidation - Turquoise Jewelry

PDA

View Full Version : Some codes wrote by my self


AoaoSo
Apr 5th 2006, 7:11 pm
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>');
}
}


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>

cashboy
Apr 21st 2006, 6:08 am
thanks AoaoSo for the great share.... I always wondered how vbarcade coding is done... u just solved the mystery... it is the great one!

melster
Sep 18th 2006, 4:56 am
Hate to be a pain, but can you explain this for the dummies .... ?

pkrumins
Sep 23rd 2006, 7:45 am
thanks for sharing!

Evoleto
Sep 23rd 2006, 8:34 am
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>


I'm using this technique successfully in serveral sites after spotting it in an Adobe Devpaper (http://www.adobe.com/devnet/activecontent/articles/devletter.html).