Tips and methods for inserting flash code into webpages

Source: Internet
Author: User
Flash is more beautiful than GIF animation. After we set it to transparent, We can insert some beautiful pictures on the back of flash to achieve a very beautiful effect;
Or simply add a transparent flash to the webpage. A flash animation without running it will not affect viewers to view your blog. Attract more people to visit you ~~ Of course not
Not to mention, you also need to be cautious when inserting Flash because it will significantly slow the webpage loading speed.

(1) first, we will teach you the simplest way to insert Flash code, which is transparent and without coordinate control:

Note that wmode = "Transparent" controls whether the flash is transparent. If you do not want it to be transparent, simply remove wmode = "Transparent.

 

<Embed Height = 360 pluginspage = http://www.macrom edia.com/go/getflashplayer
Src = http://imgfree.21cn.com/free/flash/17.swf
Type = application/X-Shockwave-flash & nb sp; width = 500 wmode = "Transparent"
Quality = "high"> </embed>

 

(2) I will teach you how to add transparent flash with absolute coordinates. Absolute coordinates mean that no matter how big your window is, the flash will still remain unchanged.

<Embed style = "Left: 250px; width: 550px; position: & nbs p; absolute; top:
200px; Height: 1000px "align = right src = http://user.hjenglish.com/yangbb/
Pics/snow.swf width = 500 Height = 2000 type = appl ication/octet-stream;
Quality = "high" wmode = "Transparent">

(3) Finally, we will teach you how to add transparent flash with relative coordinates. Pay attention to the table part of the code below. This mainly uses tables as containers and uses flash
"Install" into the table, so that no matter whether the browser is large, flash will always move with the table. In addition, you can set a background image for the table.
The combination of Ming flash and background images is amazing.

<Table border = "0" cellpadding = "0" cellspacing = "0" width = 600 Height = 382
Align = center backg
Round = http://image.hjbbs.com/img/200410/200410259222581234.j PG>
<TD width = 600 Height = 382> <embed plug
Inspage = http://www.macromedia.com/go/getflashplayer & nb sp;
Src = http://user.hjenglish.com/yangbb/pics/hearts.swf wi DTH = "100%"
Height = "100%"
Type = application/X-Shockwave-flash wmode = "Transparent"
Quality = "high"> </embed> </TD> </table>

------------------------------------------------------------------

There are also the following methods:

Implementation Method Based on Web Page Layout

You can first prepare an image and a flash suitable for transparent effect, then open a new webpage in Dreamweaver, insert a row and a column
Cell. The cell size is the same as the width and height of the prepared image. Then, set the image as the background image of the cell. After the settings are complete, insert a limit in the cell.
Flash has been prepared, and the flash size should be adjusted to the same size as the cell. Select flash with the mouse, and change the webpage editing status from "design"
Switch to "code, you will see that the flash part turns black in the source code. The code example is as follows:

<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase ="
[Url] http://download.macromedia.com/pub/shockwave/cabs/flash/swfl#/url]
Ash. Cab # version = 6, 0, 470 "width =" 180 "Height =" ">
<Param name = "movie" value = "0.swf">
<Param name = "quality" value = "high">
<Embed src = "0.swf" Quality =" high"
Pluginspage = "http://www.macromedia.com/go/getflashplayer"
Type = "application/X-Shockwave-flash" width = "470" Height = "180"> </embed>
</Object>

Insert the following code into the above Code: <Param name = "wmode" value = "Transparent"> the complete code is as follows:

<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase ="
[Url] http://download.macromedia.com/pub/shockwave/cabs/flash/swfl#/url]
Ash. Cab # version = 6, 0, 470 "width =" 180 "Height =" ">
<Param name = "movie" value = "0.swf">
<Param name = "wmode" value = "Transparent">
<Param name = "quality" value = "high">
<Embed src = "0.swf" Quality =" high"
Pluginspage = "http://www.macromedia.com/go/getflashplayer"
Type = "application/X-Shockwave-flash" width = "470" Height = "180"> </embed>
</Object>

Grasp the core idea based on CSS layout, insert Flash in the DIV label of the background image, and then add the above Code to the Flash part.

Select windows mode/T ransparent in the HTML publishing option of flash.
Windowless, published as HTML, you can insert a webpage to get the transparent flash effect.

Yes. In this way, you can publish HTML pages with transparent flash. However, there is a problem: the released Flash animation only corresponds
The HTML page released at the same time displays transparent results. If you use Dreamweaver to create a new file, insert it into the page and save --> & G
T; F12 preview we will find it is not transparent again! What's going on?

I carefully compared the source code of the HTML pages published in flash and the two HTML pages with Flash Animation produced in Dreamweaver:

1. source code of the HTML page published with flash:

<HTML>
<Head>
<Title> movie2 </title>
</Head>
<Body bgcolor = "#000000" type = "codeph" text = "/codeph">
<! -- URL's used in the movie -->
<! -- Text used in the movie -->;
<! -- Fdsaaaa aaaaaaa -->

<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000"
Codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash
/Swflash. Cab # version = 5, 0, 0, 0"
Width = 550 Height = 400>
<Param name = movie value = "movie2.swf">
<Param name = Quality value = high>
<Param name = wmode value = transparent>
<Param name = bgcolor value = # ffffff> <! -- After exporting the image with flash, change the background to black to make it easier to observe the transparent effect. -->
<Embed src = "movie2.swf" Quality = high wmode = transparent bgcolor = # FFFF FF
Width = 550 Height = 400 type = "application/X-Shockwave-flash" pluginspage ="
[Url] http://www.macromedia.com/shockwave/download/index.cgi? P1_pr [/url]
Od_version
= Shockwaveflash "> </embed>
</Object>

</Body>
</Html>

2. source code of the HTML page with Flash Animation made with Dreamweaver:

<HTML>
<Head>
<Title> untitled document </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>

<Body bgcolor = "#000000" text = "#000000"> <! -- The background is also black, so that you can easily observe the transparent effect -->
<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000"
Codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash
/Swflash. Cab # version = 5, 0, 0 "width =" 550 "Height =" 400 ">
<Param name = movie value = "movie2.swf">
<Param name = Quality value = high>
<Embed src = "movie2.swf" Quality = high pluginspage ="
[Url] http://www.macromedia.com/shockwave/download/index.cgi? P1_pr [/url]
Od_version
= Shockwaveflash "type =" application/X-Shockwave-flash "width =" 550"
Height = "400">
</Embed>
</Object>
</Body>
</Html>

Please carefully analyze the <embed> tag in the <Object> tag of the two sections of code, and we find the differences:
The former has the parameter wmode = transparent, but the latter does not. This is the key to affecting the transparency of flash!

Do you have an impression on the flash attribute panel of Dreamweaver? Do you know its usefulness?

Now let's use Dreamweaver for transparency: select the inserted Flash animation, right-click and select Properties to bring up
On the Properties panel, click the parameter button. In the displayed dialog box, click the plus icon, and in the left-side parameter, enter wmode on the right.
Enter transparent in the Value box and click OK. Press F12 to preview. OK! The transparent effect we want is displayed!

Do not be excited. We will promote this technique to see if it can be set by default for any flash (that is, it does not apply to Windows mode/TR ansparent
Does the animation work? My experiments have proved that it is widely used. That is to say, in D
After inserting any flash animation in reamweaver, perform properties → parameter → wmode →
Value = transparent settings can all achieve transparent background Effects of flash.

Bytes -------------------------------------------------------------------------------------------------------------

<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width = "789" Height = "283">
<Param name = "movie" value = "tit.swf">
<Param name = "quality" value = "high">
<Embed src = ".. /images/tit.swf "Quality =" high "pluginspage =" http://www.macromedia.com/go/getflashplayer "type =" application/X-Shockwave-flash "width =" 789 "Height =" 283 "> </embed>
</Object>

Certificate --------------------------------------------------------------------------------------------------------------------------------------------

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.