Insert SWF into html page

<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
   3 
   4  WIDTH="850"
   5 
   6  HEIGHT="610"
   7 
   8  CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
   9 
  10  <PARAM NAME="MOVIE" VALUE="2bigpinkballs2.swf">
  11 
  12  <PARAM NAME="PLAY" VALUE="true">
  13 
  14  <PARAM NAME="LOOP" VALUE="true">
  15 
  16  <PARAM NAME="QUALITY" VALUE="high">
  17 
  18  <PARAM NAME="SCALE" value="noborder">
  19 
  20  <EMBED SRC="2bigpinkballs2.swf"
  21 
  22  WIDTH="850"
  23 
  24  HEIGHT="610"
  25 
  26  PLAY="true"
  27 
  28  LOOP="true"
  29 
  30  QUALITY="high"
  31 
  32  scale="noborder"
  33 
  34  PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
  35 
  36  </EMBED>
  37 
  38  </OBJECT>

                (OR)
            

Flash Embedded in HTML

After creating a Flash movie you choose File > Save As from the top menu to save your movie. Save the file as “Somefilename.fla”.

To embed the Flash movie you just made into an HTML page, you should go back to your Flash program and do the following steps:

Step 1
Choose File > Open. Open a Flash movie you have created.

Step 2
Choose File > Export Movie.

Step 3
Name the file “somefilename.swf”. Choose the location where the file is to be stored (in your Web folder). Click OK.

Step 4
Open the HTML page where you want to insert your Flash movie. Insert this code:

<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

Note: This is the minimum code you need to embed a Flash movie in a browser. A broken icon will appear on the Web page if the user does not have the Flash plug-in installed.

Note: In the code above there is both an <embed> tag and an <object> tag. This is because the <object> tag is recognized by Internet Explorer, and Netscape recognizes the <embed> tag and ignores the <object> tag.

Step 5
Type in the address of the HTML file in your browser and look at your first Flash movie.


Let the Flash Program do the Work

The code above is the absolute minimum code to embed Flash movies in HTML pages. It is not recommended to use the minimum code. There should be a few more attributes added:

  • classid is an attribute to the <object> tag. It tells Internet Explorer to load the ActiveX plug-in if it is not installed
  • pluginspage is an attribute to the <embed> tag. It displays a link to the Shockwave download page if Netscape does not have it

The Flash program can add these attributes for you:

Step 1
Choose File > Publish. Flash will now create the <object>, <param>, and <embed> tags for you. It will also create the classid and pluginspage attributes.

Step 2
Open the HTML document that Flash created, view the HTML source and copy the code into your HTML page where you want your Flash movie.

Step 3
Be sure that you have the “somefilename.swf” in your Web folder.

Step 4
Type in the address of the HTML file in your browser and look at your first Flash movie.

(OR)

Your code should look something like this:

<OBJECT classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0″ WIDTH=”320″ HEIGHT=”240″ id=”Yourfilename” ALIGN=””>
<PARAM NAME=movie VALUE=”Yourfilename.swf”> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#333399> <EMBED src=”Yourfilename.swf” quality=high bgcolor=#333399 WIDTH=”320″ HEIGHT=”240″ NAME=”Yourfilename” ALIGN=”” TYPE=”application/x-shockwave-flash” PLUGINSPAGE=”http://www.macromedia.com/go
/getflashplayer”></EMBED> </OBJECT>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: