1. bluehost knowledge base

How To Embed Flash Files In A Web Page - Embed Code

How to embed a flash file in a webpage

<embed src="somefilename.swf" width="550" height="400"></embed>

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 - It is an attribute to the <object> tag. It tells Internet Explorer to load the ActiveX plug-in if it is not installed
  • Pluginspage - It 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:

  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.
  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.
  3. Be sure that you have the "somefilename.swf" in your Web folder.
  4. Type in the address of the HTML file in your browser and look at your first Flash movie.

Manually Creating the Page

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:

  1. Choose File > Open. Open a Flash movie you have created.
  2. Choose File > Publish Movie.
  3. Name the file "somefilename.swf". Choose the location where the file is to be stored (in your Web folder). Click OK.
  4. Open the HTML page where you want to insert your Flash movie. Insert this code.
    <XMP>
       <table width="100%" class="ex" cellspacing="0" border="1"> 
         <tr> 
          <td>
            <object width="550" height="400">
               <param name="movie" value="somefilename.swf">
               <embed src="somefilename.swf" width="550" height="400"></embed>
            </object>
          </td> 
         </tr>
       </table> 
    </XMP>

    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. 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.

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

For further assistance, you may contact our Chat Support or Phone Support via 888-401-4678. You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.