Introduction to the difference between object and embed labels used in flash content display

Time:2020-2-21

1、 Introduction:

If we want to display the flash content in the web page normally, the page must have a label specifying the flash path. That is, object and embed tags. Object tag is used for IE browser on Windows platform, while embed is used for Netscape Navigator browser on windows and Macintosh platform and IE browser on Macintosh platform. IE on Windows platform uses ActiveX control to play flash while other browsers use Netscape plug-in technology to play flash.

The following is a simple code example of inserting flash into a web page:

Code:

Copy code

The code is as follows:

<OBJECT classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0″
WIDTH=”550″ HEIGHT=”400″>
<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 use all of the above labels? Can some labels be omitted?

The object tag is used for windows Ie3.0 and later browsers or other browsers that support ActiveX controls. The “CLassID” and “codebase” attributes must be written exactly as shown in the above example, telling the browser the address of the flash player to download automatically. If you haven’t installed flash player, browsers after Ie3.0 will pop up a prompt box to access whether to install flash player automatically. Of course, if you don’t want users who don’t have Flash Player installed to download the player automatically, maybe you can omit the code.
The embed tag is used for Netscape Navigator 2.0 and later browsers or other browsers that support Netscape plug-ins. The pluginspage property tells the browser the address to download the flash player. If the flash player has not been installed, the user needs to restart the browser to use it normally after installation.
To ensure that most browsers display flash properly, you need to nest the embed tag inside the object tag, as in the code example above. Browsers that support ActiveX controls will ignore the embed tag within the object tag. Netscape and IE browsers that use plug-ins will only read the embed tag and will not recognize the object tag. That is to say, if you omit the embed tag, Firefox can’t recognize your Flash (but I wonder that if you omit the object and only write embed, ie can also display flash normally. Ha ha, let’s take a closer look at the details).

The necessary and optional attributes for the object and embed tags used to publish the movie are listed below.

1、 Required properties:

·CLassID – sets the browser’s ActiveX control for object tags only.
·Codebase – sets the location of the flash ActiveX control, so if the browser is not installed, it can download and install automatically. For object tags only.
·Width – specifies the width of the flash movie as a percentage or pixel.
·Height – specifies the height of the flash movie as a percentage or pixel.
·SRC – specifies the download address for the movie. For embed tags only.
·Pluginspage – sets the location of the flash plug-in, so if the browser is not installed, it can download and install automatically. For embed tags only.
·Movie – specifies the download address for the movie. For object tags only.

2、 Optional properties and available values:

·ID – sets the variable name for the reference of the script code. For object only.
·Name – sets the variable name to be used for references to script code, such as JavaScript. For embed only.
·Swliveconnect – (true or false) specifies whether Java is enabled when the flash player first downloads. If some properties are omitted, 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 movie will play automatically after downloading. If this attribute is omitted, it defaults to true.
·Loop – (true or false) specifies whether to stop or continue looping after the last frame of the movie is played. If this attribute is omitted, it defaults to true.
·Menu – (true or false)
·True displays all menus, allowing users to zoom in, zoom out and other operations such as controlling movie playback.
·False display contains only setup options and menus about flash.
·QUALITY – (low, high, autolow, autohigh, best )
·Low speed is better than beautiful, and anti aliasing is not applied.
·Autolow was initially focused on speed, but it’s always beautiful when it’s needed.
·Autohigh focuses on playing speed and aesthetics at the same time, but sacrificing aesthetics to ensure playing speed when necessary.
·Medium applies some antialiasing and bumpy bitmaps. Its quality is higher than the low setting and lower than the high setting.
·High is more beautiful than playback speed, and anti aliasing is always used. If the movie does not contain animation, the bitmap is smoothed; if the movie contains animation, the bitmap is not smoothed.
·Best provides the best display quality regardless of playback speed. All output is antialiased and all bitmaps are smoothed.
·SCALE – (showall, noborder, exactfit)
·The default (show all) movie is displayed in the specified area, but at the original scale. Borders appear on both sides of the movie.
·No boder shrinks the movie to fit the specified area, keeping the movie undistorted, but some movies may be cropped. However, keep the original proportion of the film.
·Exact fit makes the entire movie appear in the specified area. It is possible for the movie to deform and distort without maintaining the original scale.
·ALIGN – (l, t, r, b)
·The default is center. When the browser window is smaller than the movie, the edge will be cut.
·Left, right, top, bottom align along the edge of the browser according to the corresponding settings. If necessary, the other three sides will be cut.
·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 movie, specifying the transparency, cascade and location of flash in the browser.
·The window movie plays in its own rectangular window in the browser.
·The opaque movie hides everything behind it.
·Transparent makes the flash movie transparent and displays the web content behind the transparent movie. This will degrade the performance of the animation. And this property is not available in all browsers.
·Bgcolor – (ාrrggbb, hexadecimal RGB value.) Specifies the background color for the movie. Use this property to override the background color set in flash.
·Base – set the base directory or URL to solve all the relative paths in flash. Similar to the < base > tag in a web page.
·Flashvars transfers variables to flash player. Flash player 6 and later are required.
·Pass the root level variable to the movie. The format of the string is a set of name = value separated by “&”.
·The browser supports a string length of 64KB.

Recommended Today

[Redis5 source code learning] analysis of the randomkey part of redis command

baiyan Command syntax Command meaning: randomly return a key from the currently selected databaseCommand format: RANDOMKEY Command actual combat: 127.0.0.1:6379> keys * 1) “kkk” 2) “key1” 127.0.0.1:6379> randomkey “key1” 127.0.0.1:6379> randomkey “kkk” Return value: random key; nil if database is empty Source code analysis Main process The processing function corresponding to the keys command is […]