Tutorials Displaying a Flash Movie (.swf) in a HTML page

This tutorial will show you how to display a Flash Movie (.swf) in a HTML page using the <OBJECT> and <EMBED> tags.

To correctly display a Flash movie (.swf) in a browser, you should use an HTML page instead of directly using the Flash (.swf) file. The HTML page must contain the <OBJECT> and <EMBED> tags that reference the Flash movie (.swf) file to be displayed. The <OBJECT> tag is used by Internet Explorer on Windows and the <EMBED> tags are used by most other browsers including Netscape, Mozilla, Firefox (Windows and Macintosh) and Internet Explorer and Safari (Macintosh). So you should include both <OBJECT> and <EMBED> tags so your Flash file can be viewed on various browsers.

Below is a simple example of using the <OBJECT> and <EMBED> tags. You can copy and paste the following block of HTML code into your own HTML file. You will need to change the WIDTH and HEIGHT parameters to the dimensions you wish to display the Flash file at. Also replace the "MyFlashMovie.swf" with the filename of your .swf file you want to display in the HTML page.Note, you will have to change these values in both the <OBJECT> and <EMBED> tags.

<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="320" HEIGHT="240" id="MyMovieName">
<PARAM NAME=movie VALUE="MyFlashMovie.swf">
<PARAM NAME=quality VALUE=high>
<EMBED src="MyFlashMovie.swf" quality=high WIDTH="320" HEIGHT="240"
NAME="MyMovieName" ALIGN="" TYPE="application/x-shockwave-flash"

<OBJECT> and <EMBED> Tag Attributes

Required attributes:

Optional attributes: