Flash slides can be used only after ActiveX controls are activated.

Source: Internet
Author: User

For various reasons, Microsoft restricts the use mode of IE ActiveX after SP2, that is, there is a virtual box in ActiveX on the page, and you need to click it once to interact normally. Flash is embedded into web pages as an ActiveX, so it is also affected. This problem can be solved only when Flash is embedded through Js. No flash version check. If the flash plug-in version of the browser is not available, or your SWF file cannot be properly displayed, alternatively, an ActiveX confirmation and installation box will pop up. This box is terrible for many users. After searching for the box for a long time online, there is no slide advertisement. Code No way. I did my research and passed the test.

First, in the <Script. src = "AD/global. js" type = "text/JavaScript"> </SCRIPT>

The global. js code is as follows:Copy codeThe Code is as follows: function my_getbyid (ID)
{
ITM = NULL;
If (document. getelementbyid)
{
ITM = Document. getelementbyid (ID );
}
Else if (document. All)
{
ITM = Document. All [ID];
}
Else if (document. layers)
{
ITM = Document. Layers [ID];
}

Return ITM;
}

Function Sunad (element, URL, width, height, images, links, texts)
{
If (! My_getbyid (element) return;
VaR STR = '';
STR + = '<object classid = "CLSID: d27cdb6e-ae6d-11cf-96b8-444553540000" codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,9,0" width = "' + width + '" Height = "' + height + '"> ';
STR + = '<Param name = "allowScriptAccess" value = "samedomain"> <Param name = "movie" value = "' + URL + '"> <Param name = "Quality "value =" high "> <Param name =" bgcolor "value =" # ffffff "> ';
STR + = '<Param name = "menu" value = "false"> <Param name = wmode value = "Opaque"> ';
STR + = '<Param name = "flashvars" value = "pics =' + Images + '& links =' + Links + '& texts =' + texts + '& borderwidth = '+ width +' & borderheight = '+ height +' & textheight = 0 "> ';
STR + = '<embed src = "' + URL + '" wmode = "Opaque" flashvars = "pics =' + Images + '& links =' + Links + '& texts = '+ texts +' & borderwidth = '+ width +' & borderheight = '+ height +' & textheight = 0 "menu =" false "bgcolor =" # ffffff "Quality = "high" width = "'+ width +'" Height = "'+ height +'" allowScriptAccess = "samedomain" type = "application/X-Shockwave-flash" pluginspage =" http://www.macromedia.com/go/getflashplayer "/> ';
STR + = '</Object> ';
My_getbyid (element). innerhtml = STR;
}

to place a slide, use the following code to overwrite it. You can also write the following code as a separate file for calling.
for example, the file name is ad. ASP, called in the slide area: copy Code the code is as follows:



Url_0 = "http://www.abc.com ";
Img_0 = "http://www.abc.com/01.jpg ";
Url_1 = "http://www.abc.com ";
Img_1 = "http://www.abc.com/02.jpg ";
Url_2 = "http://www.abc.com ";
Img_2 = "http://www.abc.com/03.jpg ";
Url_3 = "http://www.abc.com ";
Img_3 = "http://www.abc.com/04.jpg ";
Url_4 = "http://www.abc.com ";
Img_4 = "http://www.abc.com/05.jpg ";
VaR focus_width = 250
VaR focus_height = 250
VaR text_height = 0
VaR swf_height = focus_height + text_height
VaR pics = img_0 + "|" + img_1 + "|" + img_2 + "|" + img_3 + "|" + img_4
VaR links = url_0 + "|" + url_1 + "|" + url_2 + "|" + url_3 + "|" + url_4
VaR texts = '';
VaR focus = 'HTTP: // www.abc.com/ad/focus.swf ';
Sunad ('Story _ flash', focus, focus_width, swf_height, pics, links, texts)
</SCRIPT>
</A>

In the above Code: var focus = 'HTTP: // www.abc.com/ad/focus.swf ';
The focus.swf in this sentence is a flash playback file.

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.