Example on how to embed a flash file in a webpage
Posted by Support on 20 December 2007 04:02 AM

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:

<table width="100%" class="ex" cellspacing="0" border="1">
    <td> <pre><object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</object></pre> </td>

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 <embed> and <object> tags. It will also create the classid and pluginspage attributes.

Step 1
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 2
Be sure that you have the "somefilename.swf" in your Web folder.

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

(634 vote(s))
Not helpful

Comments (0)