Right-click FLASH shielding

Source: Internet
Author: User

1. Create a new JS file and add the following code: block the right-click FLASH

Function tmh _ make_ad_fodder (src, width, height)
{
Src = src. replace ("","");
Var TEMP_IMAGE = ' ';
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 "'
+ 'Ininspage = "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; minimum Opacity: 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;
}

Save as "flash. js ".

2. Add code to HTML, ASP, and other pages for FLASH:

<Script language = "JavaScript" type = "text/javascript" src = "flash. js"> </script>
<Script language = "javascript"> taoshaw_unright_shazi ('_ parent', 'youfor2.swf ', '000000', '000000', "", true); </script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.