屏蔽FLASH右键
1、新建一JS文件,加入如下代码: 屏蔽FLASH右键
function tmh__make_ad_fodder(src, width, height)
{
src = src.replace(" ", "");
var TEMP_IMAGE = ’<img src="$src$" height="$height$" width="$width$" border="0" />’;
var TEMP_FLASH = ’<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ’
+ ’ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" ’
+ ’ height="$height$" width="$width$"> ’
+ ’<param name="movie" value="$src$" /> ’
+ ’<param name="quality" value="high" /> ’
+ ’<param name="wmode" value="opaque" /> ’
+ ’<EMBED src="$src$" quality="high" WIDTH="$width$" HEIGHT="$height$" ’
+ ’ wmode="opaque" TYPE="application/x-shockwave-flash" ’
+ ’ PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> ’
+ ’</object>’;
return (/\.swf$/gi.test(src) == true ? TEMP_FLASH : TEMP_IMAGE)
.replace(/\$src\$/gi, src)
.replace(/\$width\$/gi, width)
.replace(/\$height\$/gi, height)
;
}
function tmh__make_ad_content(strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover)
{
var TEMP_LINK = ’$ad_fodder$’;
var TEMP_COVER = ’<div style="width:$width$px; height:$height$px; ’
+ ’ position:absolute; background-color:#000000; z-index:9999; ’
+ ’ filter:Alpha(Opacity=0); opacity:0.0; MozOpacity:0.0; KhtmlOpacity:0.0; "></div>’
+ ’$ad_fodder$’;
var src = strImageName || strImageUrl;
var width = parseInt(iWidth);
var height = parseInt(iHeight);
var click_url = strClickUrl || "http://www.jalaobiao.cn/";
var ad_fodder = tmh__make_ad_fodder(src, width, height);
if (/\.swf$/gi.test(src) == false) {
return TEMP_LINK
.replace(/\$ad_fodder\$/gi, ad_fodder)
.replace(/\$click_url\$/gi, click_url)
;
}
// flash
if (blClickCover == false) {
return ad_fodder;
}
return TEMP_COVER
.replace(/\$width\$/gi, width)
.replace(/\$height\$/gi, height)
.replace(/\$click_url\$/gi, click_url)
.replace(/\$ad_fodder\$/gi, ad_fodder)
;
}
function taoshaw_unright_shazi(strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover)
{
document.write(tmh__make_ad_content(strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover));
}
function tmh__show_pop_ad_content(csPopSpanObj,strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover)
{
var strScript = tmh__make_ad_content(strImageUrl,strImageName,iWidth,iHeight,strClickUrl,blClickCover);
csPopSpanObj.innerHTML = strScript;
}
{
src = src.replace(" ", "");
var TEMP_IMAGE = ’<img src="$src$" height="$height$" width="$width$" border="0" />’;
var TEMP_FLASH = ’<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ’
+ ’ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" ’
+ ’ height="$height$" width="$width$"> ’
+ ’<param name="movie" value="$src$" /> ’
+ ’<param name="quality" value="high" /> ’
+ ’<param name="wmode" value="opaque" /> ’
+ ’<EMBED src="$src$" quality="high" WIDTH="$width$" HEIGHT="$height$" ’
+ ’ wmode="opaque" TYPE="application/x-shockwave-flash" ’
+ ’ PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> ’
+ ’</object>’;
return (/\.swf$/gi.test(src) == true ? TEMP_FLASH : TEMP_IMAGE)
.replace(/\$src\$/gi, src)
.replace(/\$width\$/gi, width)
.replace(/\$height\$/gi, height)
;
}
function tmh__make_ad_content(strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover)
{
var TEMP_LINK = ’$ad_fodder$’;
var TEMP_COVER = ’<div style="width:$width$px; height:$height$px; ’
+ ’ position:absolute; background-color:#000000; z-index:9999; ’
+ ’ filter:Alpha(Opacity=0); opacity:0.0; MozOpacity:0.0; KhtmlOpacity:0.0; "></div>’
+ ’$ad_fodder$’;
var src = strImageName || strImageUrl;
var width = parseInt(iWidth);
var height = parseInt(iHeight);
var click_url = strClickUrl || "http://www.jalaobiao.cn/";
var ad_fodder = tmh__make_ad_fodder(src, width, height);
if (/\.swf$/gi.test(src) == false) {
return TEMP_LINK
.replace(/\$ad_fodder\$/gi, ad_fodder)
.replace(/\$click_url\$/gi, click_url)
;
}
// flash
if (blClickCover == false) {
return ad_fodder;
}
return TEMP_COVER
.replace(/\$width\$/gi, width)
.replace(/\$height\$/gi, height)
.replace(/\$click_url\$/gi, click_url)
.replace(/\$ad_fodder\$/gi, ad_fodder)
;
}
function taoshaw_unright_shazi(strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover)
{
document.write(tmh__make_ad_content(strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover));
}
function tmh__show_pop_ad_content(csPopSpanObj,strImageUrl, strImageName, iWidth, iHeight, strClickUrl, blClickCover)
{
var strScript = tmh__make_ad_content(strImageUrl,strImageName,iWidth,iHeight,strClickUrl,blClickCover);
csPopSpanObj.innerHTML = strScript;
}
另存为"flash.js"。
2、在需要添加FLASH的HTML或者ASP以及其他页面中添加代码:
<script language="JavaScript" type="text/javascript" src="flash.js"></script>
<script language="javascript">taoshaw_unright_shazi(’_parent’, ’youfor2.swf’, ’550’, ’400’, "", true );</script>
<script language="javascript">taoshaw_unright_shazi(’_parent’, ’youfor2.swf’, ’550’, ’400’, "", true );</script>
补充:flash教程,As3.0