Home  >  Article  >  Web Front-end  >  Discussion on the close button of Flash couplet ads_Basic knowledge

Discussion on the close button of Flash couplet ads_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 19:20:00969browse

Couplet-style Flash ads that are symmetrical on both sides of the page are very common. Let’s not talk about how to create couplet ads today. We will mainly talk about the code of the small “×” (close button) in Flash ads and its connection with the external web page environment. The production of this close button also requires a bit of knowledge.

The specific steps are as follows: Draw a small “×” shape to close the button. This shouldn’t be difficult, right? After all are selected, press the F8 key to convert it into a "button" component. After clicking to select this small button, press the F9 key to open the action panel and add the following code:

<strong>以下为程序代码:</strong><br>on (release)<br>{<br>  getURL("FSCommand:", "");<br>}

Is it that simple? Yes, it’s that simple in Flash. Of course, you still need to do the following work in the web page. Here we use more JavaScript to make our code block a very portable couplet. The entire code is as follows:
<strong>以下为程序代码:</strong><br><!-- 对联开始 --><br><SCRIPT language=JavaScript event=FSCommand() for=dl> <br>duilian2.style.visibility='hidden'; <br>duilian3.style.visibility='hidden'; <br></SCRIPT><p><SCRIPT language=JavaScript> <br>function winload() <br>{ <br>  duilian2.style.top=20; <br>  duilian2.style.left=5; <br>  duilian3.style.top=20; <br>  duilian3.style.right=5; <br>} <br>//if(document.body.offsetWidth>800){ <br>{ <br>  document.write("<div id=duilian2 style='position: absolute;visibility:visible;z-index:1'><EMBED src='/images/banner.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=dl></EMBED></div>" <br>+"<div id=duilian3 style='position: absolute;visibility:visible;z-index:1'><EMBED src='/images/banner.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=dl></EMBED></div>"); <br>} <br>winload() <br>//} <br></SCRIPT><br><!-- 对联结束 --></p>

This entire part contains two JS code blocks. From the first one, it can be seen that it sets the visibility of duilian2 and duilian3 when the event FSCommand() occurs in the couplet Flash. The (visible) attribute is hidden. The second piece of JS is to insert the couplet advertisement and set the position where the couplet appears in the browser window. {}

Insert the above code into any web page, then copy the couplet Flash to the same directory as that web page, and you can view it when browsing. Do you feel like you have learned a trick again?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn