Flash OBJECT and EMBED tag (Part one)

  • dream party
  • Born
  • Born
  • User avatar
  • Posts: 4

Post 3+ Months Ago

Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I wrote this article.
This article includes two parts:
1. General introduction to the two tags.
2. Why do we use all the tags above? Is there any tag that can be left out?

1. General introduction to the two tags.

To display Flash correctly on web page, HTML tags which indicate the path of the Flash file is needed in the web page. These HTML tags are OBJECT tag and EMBED tag. OBJECT tag is used for IE on Windows, while EMBED tag is for Netscape Navigator on Windows and Macintosh and IE on Macintosh. IE on Windows play Flash with ActiveX component while other web browsers play Flash with Netscape plug-in technique. The code below is an example used to embed Flash file to web page.
Example HTML Code:
Code: [ Select ]
<OBJECT classid="clasid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
WIDTH="432" HEIGHT="330" id="myMovieName" >
<PARAM NAME="movie" VALUE="myMovieName.swf" />
<PARAM NAME="quality" VALUE="high" />
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="/flash/ myMovieName.swf" quality="high" bgcolor=#FFFFFF WIDTH="432" HEIGHT="330" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
  1. <OBJECT classid="clasid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
  2. WIDTH="432" HEIGHT="330" id="myMovieName" >
  3. <PARAM NAME="movie" VALUE="myMovieName.swf" />
  4. <PARAM NAME="quality" VALUE="high" />
  5. <PARAM NAME=bgcolor VALUE=#FFFFFF>
  6. <EMBED src="/flash/ myMovieName.swf" quality="high" bgcolor=#FFFFFF WIDTH="432" HEIGHT="330" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
  7. </EMBED>
  8. </OBJECT>


Part 2 "Why do we use all the tags above? Is there any tag that can be left out?" will be continued soon enough:)
Moderator Remark: Garbage removed
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Thank you for posting this Dream Party. It could be useful for anyone who runs across that code and wants a further understanding.

However, using the Object Embed method is no longer recommended for placing ActiveX objects (Flash, Wmv, Shockwave, Etc). The <embed> tag is not valid HTML and therefore poses render problems as browsers become more standards compliant. Its now generally accepted that you should use a Javascript method to place and display swf files. Javascript methods are not only standards compliant but also offer simple solutions for passing browser data to/from Flash and provide options for alternate (non-Flash) content to be displayed.

There are many Javascript Flash embedding methods available with the most popular being the SWFObject and Adobe Flash Player Detection Kit (Included when you publish from Flash versions 8+).

More Information about these methods and their use/disuse is available at A List Apart
  • dream party
  • Born
  • Born
  • User avatar
  • Posts: 4

Post 3+ Months Ago

Thank you very much for your advice.
Now part two is finished.

Why do we use all the tags above? Is there any tag that can be left out?

OBJECT tag is used for IE 3.0 on Windows & later version of IE and other web browsers that supports ActiveX component. Value of attribute “classid” and “codebase” must be accurate the same as the example code above. These two attributes tell web browsers the download URL address of Adobe Flash Player automatically. If you haven’t installed Adobe Flash Player, IE 3.0 and later version of IE will pop up a dialog box that asks if you want to install Adobe Flash Player automatically. If you don’t want to enable the users that haven’t installed Adobe Flash Player to automatically install it, you can leave out these two attributes.

Embed tag is used for Netscape Navigator2.0 and later version and other web browsers that supports Netscape plug-ins technique. Attribute “PLUGINSPAGE” indicates the download address of Adobe Flash Player to web browser. If Internet users haven’t installed Adobe Flash player, after the installation, they have to reboot their web browsers.

To ensure displaying Flash correctly on most web browsers, you have to nest the EMBED tag in the OBJECT tag, just like the example code above. Web browsers supports ActiveX component will automatically ignore the EMBED tag nested in the OBJECT tag. Netscape browser and Netscape plug-in supported browsers will only read EMBED tag neglected OBJECT tag. i.e. if you leave out the EMBED tag, Firefox will not identify your Flash file. (For a wonder, if OBJECT tag is left out but only with EMBED tag, IE also can display Flash correctly LOL. More discussion on this issue will be continued)

Required and optional attributes of OBEJCT tag and EMBED tag for publishing videos to the Internet are as follow:

(1). Required attributes

•CLASSID - Used to set the ActiveX component. It is only used in OBJECT tag.
•CODEBASE - Used to indicates the URL of the ActiveX component, so if the ActiveX component is not installed in web browser, it will automatically download it. It is only used in OBJECT tag.
•WIDTH - Indicates the width of the video with percentage or pixel.
•HEIGHT - Indicates the height of the video with percentage or pixel.
•SRC - Indicates the URL of the video (relative or absolute path). For EMBED tag only.
•PLUGINSPAGE - Used to indicates the location of plug-in Adobe Flash Player, so if this plug-in is not installed, it enables the page automatically install it. For EMBED tag only.
•MOVIE - Indicates the location of the video. For OBJECT tag only.

(2). Optional attributes and their available value

•ID - Identifies the reference name of the flash movie, so that it can be referenced by scripting language such as JavaScript or VBScript. (attribute for OBJECT tag only)
•NAME - Identifies the reference name of the flash movie, so that it can be referenced by scripting language. (attribute for EMBED tag only)
•SWLIVECONNECT - (true or false) Specifies whether the web browser should start Java when loading the Adobe Flash Player for the first time. The default value is false if this attribute is omitted. If you use JavaScript and Flash on the same web page, Java must use FSCommand to work.
•PLAY - (true or false) The default value is true if this attribute is omitted. Specifies whether the flash movie should plays automatically while loading in the web browser.
•LOOP - (true or false) Specifies whether the flash video should replay or stops when it comes to the last frame.
•MENU - (true or false)

* true - display the full menu, allowing the Internet users a wide range of options to zoom, enhance, etc.

* false - display the menu that contains only the Settings option and About Flash option.

•QUALITY - (low, high, autolow, autohigh, best)

* low - prefers playback speed other than appearance and never uses anti-aliasing.

* high - prefers appearance other than playback speed and always uses anti-aliasing. If the movie does not contain animation, bitmaps are smoothed; if the movie has animation, bitmaps are not smoothed.

* autolow - emphasizes playback speed at first but improves appearance whenever possible. Playback begins with anti-aliasing turned off. If the Flash Player detects that the processor can handle it, anti-aliasing is turned on.

* autohigh - emphasizes playback speed and appearance equally at first but sacrifices appearance for playback speed if necessary. Playback begins with anti-aliasing turned on. If the actual frame rate drops below the specified frame rate, anti-aliasing is turned off to improve playback speed. Use this setting to emulate the View > Antialias setting in Flash.

* best - provides the best display quality and does not consider playback speed. All output is anti-aliased and all bitmaps are smoothed.

•SCALE - (showall, noborder, exactfit)

* showall - default value. Maintaining the original aspect ratio of the movie so that the entire flash video can be visible in the specified area without distortion. Blank may appear on two sides of the video.

* noborder - Maintaining the original aspect ratio of the movie, but the flash video may possibly with some cropping without distortion while the video is scaled to fill the specified area.

* exactfit - makes the entire movie visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur.

•ALIGN - (l, t, r, b)

* l, r, t, and b - align the movie along the left, right, top or bottom edge, respectively, of the browser window and crop the remaining three sides as needed.

* tl and tr - align the movie to the top left and top right corner, respectively, of the browser window and crop the bottom and remaining right or left side as needed.

* bl and br - align the movie to the bottom left and bottom right corner, respectively, of the browser window and crop the top and remaining right or left side as needed.

•WMODE - Possible values: window, opaque, transparent. Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser.

* window - movie plays in its own rectangular window on a web page.

* opaque - the movie hides everything on the page behind it.

* transparent - the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance.

•BGCOLOR - [ hexadecimal RGB value] in the format #RRGGBB . Specifies the background color of the movie. Use this attribute to override the background color setting specified in the Flash file. This attribute does not affect the background color of the HTML page.
•BASE - . or [base directory] or [url]. Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.
•FLASHVARS - Possible values: variable to pass to Flash Player. Requires Macromedia Flash Player 6 or later.

* Used to send root level variables to the movie. The format of the string is a set of name=value combinations separated by '&'.

* Browsers will support string sizes of up to 64KB (65535 bytes) in length.

* For more information on FlashVars, please refer to "Using FlashVars to pass variables to a SWF" (TechNote tn_16417).
Moderator Remark: Garbage removed
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

IE 3.0 ?!

I think it's safe to say we can all ignore everything other than the last three paragraphs of graphixboys post in this thread.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Actually the majority of it is either an exact copy and paste, or slight rephrase from a few Adobe knowledge base articles and all of it is a complete copy from his blog which is basically only there to advertise an FLV converter.

And you're right, Joe. This stuff is pretty dated.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 24 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.