Convert: Play flash with the object and embed labels

Source: Internet
Author: User

I. Introduction:
To display the Flash content normally on the webpage, you must have a tag with the specified flash path. That is, object and
Embed label. The object tag is used by IE browser on Windows platform, and embed is used by windows and
The Netscape Navigator browser on the Macintosh platform and the IE browser on the Macintosh platform. Windows platform IE
The ActiveX control is used to play flash, while other browsers use the Netscape plug-in technology to play flash.

The following is a simple example of code for inserting flash into a webpage:

Code:

<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000"
Codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#versio
N = 6, 0, 40, 0"
Width = "550" Height = "400" id = "mymoviename">
<Param name = movie value = "myflashmovie.swf">
<Param name = Quality value = high>
<Param name = bgcolor value = # ffffff>
<Embed src = "/support/flash/TS/documents/myflashmovie.swf" Quality = high bgcolor = # ffffff
Width = "550" Height = "400"
Name = "mymoviename" align = "" type = "application/X-Shockwave-flash"
Pluginspage = "http://www.macromedia.com/go/getflashplayer">
</Embed>
</Object>

2. Why should all the above labels be used? Can some labels be omitted?
The object tag is used in Windows ie3.0 and later browsers or other browsers that support ActiveX controls. "Classid" and
The "codebase" attribute must be exactly written as shown in the preceding example. They tell the browser to automatically download the Flash Player address. For example
If you have not installed Flash Player, then ie3.0 and later browsers will jump out of a prompt box to access whether to automatically install flash
Player. Of course, if you do not want users who do not have Flash Player installed to automatically download the player, you may omit this
Some code.
Embed labels are used in Netscape navigator2.0 and later browsers or other browsers that support the Netscape plug-in.
The pluginspage attribute tells the browser to download the Flash Player address. If Flash Player has not been installed, you can install
After that, you must restart your browser to make it available.
To ensure that most browsers can display flash normally, you need to nest the embed tag in the object tag, as shown in the previous generation
The code example is the same. Browsers that support ActiveX controls will ignore the embed tag in the object tag. Netscape and plug-in
The IE browser will only read the embed tag and will not recognize the object tag. That is to say, if you omit the embed tag,
Firefox won't be able to recognize your flash (but it's a bit confusing that, If you omit the object and write it only to the embed, ie can also display the flash normally.
).

The following lists the necessary and optional attributes of the object and embed labels used to publish a video.

1. required attributes:
· Classid-sets the ActiveX control of the browser, which is only used for object labels.
· Codebase-set the position of the Flash ActiveX control. If the browser is not installed, it can be automatically downloaded and installed.
Only used for object tags.
· Width-specify the width of the Flash video in percentages or pixels.
· Height-specify the height of the Flash video in percentages or pixels.
· Src-specifies the video. Only for embed labels.
· Pluginspage-set the flash plug-in location. If the browser is not installed, it can be automatically downloaded and installed. Use only
Embed label.
· Movie-specifies the video. Only used for object tags.

2. Optional attributes and available values:
· ID-set the variable name for reference of script code. Only for objects.
· Name-set the variable name for reference of script code (such as JavaScript. Embed only.
· Swliveconnect-(true or false) Specifies whether to enable Java when Flash Player is downloaded for the first time. If some attributes are saved
The default value is false. If you use JavaScript and flash on the same page, Java must use fscommand to work.
· Play-(true or false) specifies whether the Flash video is automatically played after the download is complete. If this attribute is omitted, the default value is true.
.
· Loop-(true or false) Specifies whether to stop or continue loop playback after the last frame of the video is played. If this attribute is omitted
True.
· Menu-(true or false)
· True: displays all menus, allowing you to zoom in or zoom out to control video playback and other operations.
· False: only the set options and flash menus are displayed.
· Quality-(low, high, autolow, autohigh, best)
· Low is faster than beautiful and does not apply anti-sawtooth.
· Autolow focuses on speed at the beginning, but it can be improved at any time when needed.
· Autohigh focuses on both playback speed and aesthetic, but sacrifices the aesthetic to ensure playback speed when needed.
· Medium applies some anti-sawtooth bitmap without smoothing the bitmap. Its quality is higher than the low setting but lower than the high setting.
· High aesthetics is superior to playback speed, and anti-aliasing is always applied. If the video does not contain an animation, the bitmap will be smoothed; if the video package
Animation included, the bitmap will remain unchanged.
· Best provides the best display quality without considering the playback speed. All outputs apply anti-sawtooth and all bitmaps are smoothed.
· Scale-(showall, noborder, exactfit)
· The default (show all) video is displayed in the specified area, but the original proportion is maintained. A border will appear on both sides of the video.
· No boder compresses the film to fit the specified area and keeps the film undistorted. However, some films may be cropped. However, keep the video
Original proportion.
· Exact fit enables the entire video to be displayed in the specified area. The film may be distorted without retaining the original proportion.
· Align-(L, t, R, B)
· The default value is center. When the browser window is smaller than the video, the edge is cropped.
· Left, right, top, and bottom are aligned along the edge of the browser according to the corresponding settings. If necessary, the other three sides will be cropped.
· Salign-(L, t, R, B, Tl, TR, BL, Br)
· L, R, T, B
· TL, tr
· BL, BR
· Wmode-(window, opaque, transparent) sets the window mode attribute of the Flash video, specifying the Flash file in the browser
Is transparent, stacked, and positioned.
· Window Film is played in the browser's rectangular window.
· The opaque film hides all content behind it.
· Transparent makes the Flash video transparent and displays the webpage content behind the transparent video. This will reduce the animation performance. And this genus
Is not available in all browsers.
· Bgcolor-(# rrggbb, hexadecimal RGB value .) Specifies the background color of the video. Use this property to overwrite settings in Flash
Background color.
· Base-sets the reference directory or URL to solve the relative path in flash. Similar to the <base> label on a webpage.
· Flashvars transmits variables to Flash Player. Flash player6 and later versions are required.
· Pass the root variable to the video. The string format is the name = value set separated.
· The browser supports 64 kB String Length.
· For more information about flashvars, see related documents.

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.