Insert FLASH (swf file) into the webpage, and make Flash not block HTML elements,

Source: Internet
Author: User

Insert FLASH (swf file) into the webpage, and make Flash not block HTML elements,
I. The flash code inserted into the webpage is as follows:Of course, many attributes can be removed, depending on the specific needs. We often encounter playing flash on webpages. To Play flash normally, we need to use the OBJECT and EMBED tags. In view of the incompatibility between Firefox, IE, and other browser vendors. Playing flash is also different.OBJECT Tag: Used in IE browser on windows to play flash with Activex control.EMBED label: Used in the NetscapeNavigator browser on windows and Macintosh platforms to play flash with the Netscape plug-in technology.We usually write this statement to ensure compatibility with various browsers, for example:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%"    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">    <param name="movie" value="flash/flash1.swf">    <param name="quality" value="high">    <param name="bgcolor" value="#F0F0F0">    <param name="menu" value="false">    <param name="wmode" value="opaque"><!--Window|Opaque|Transparent-->    <param name="FlashVars" value="">    <param name="allowScriptAccess" value="sameDomain">    <embed id="forfunex" src="flash/flash1.swf"        width="100%"        height="100%"        align="middle"        quality="high"        bgcolor="#f0fff8"        menu="false"        play="true"        loop="false"        FlashVars=""        allowScriptAccess="sameDomain"        type="application/x-shockwave-flash"        pluginspage="http://www.adobe.com/go/getflashplayer" wmode="opaque">    </embed></object> 

The purpose is to ignore the content of the EMBED label when using an OBJECT in IE. Firefox and other browsers use EMBED to ignore tags such as objects.

 

Ii. Prevent HTML elements from being blocked by Flash

Place flash Under the DIV layer, so that flash does not block the floating layer or drop-down menu, so that Flash does not file the key parameter of the floating object or layer: wmode = opaque.

The method is as follows:

For IE, add the parameter <param name = "wmode" value = "opaque"/> to <object> </object>

Add the wmode = "opaque" parameter to FF <embed/>"

 

If you want transparent Flash

Key attributes that make Flash transparent:
<Param name = "wmode" value = "transparent">

 

Wmode attribute/parameter value Window | Opaque | Transparent

Template variable: $ WM (optional) allows you to use transparent Flash content, absolute positioning, and hierarchical display in Internet Explorer 4.0. This tag/attribute is only valid in Windows with the Flash Player ActiveX control.

"Window" uses the film's own rectangular Window on the Web page to play the application. "Window" indicates that the Flash application has no interaction with the HTML layer and is always at the top layer.

"Opaque" hides all content on the page after the application.

"Transparent" enables the background of an HTML page to be displayed through all the Transparent parts of the application, and may reduce the animation performance.

Both "Opaque windowless" and "Transparent windowless" can interact with the HTML layer to allow the layer above the SWF file to mask the application. The difference between the two options is that "Transparent" allows transparency. Therefore, if a part of the SWF file is Transparent, the HTML layer below the SWF file can be displayed through this part, "opaque" is not displayed.

If this attribute is ignored, the default value is Window. Only applies to objects.

 

Author: rainbow after the storm

Source: http://www.cnblogs.com/moqiutao/

If you think this article is helpful to your learning, please provide more support and encouragement.

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.