How to 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:

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 tag and an tag. This is because the tag is recognized by Internet Explorer, and Netscape recognizes the tag and ignores the 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 tag. It tells Internet Explorer to load the ActiveX plug-in if it is not installed
  • pluginspage is an attribute to the 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 , , and 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.


    HTML Tags

    align=alignment

    Determines how to align the object. May have the following values:

    CENTER Center the header
    LEFT Align to the left
    RIGHT Align to the right
    "browser specific parameter"=value

    Any number of browser specific parameters which are needed by the embedded object.

    autostart="n" Internet Explorer and Netscape. Indicates if the sound should start automatically. Netscape default is TRUE, Internet Explorer is FALSE.
    endtime="mm:ss" Netscape. Indicates spot (minutes and seconds) on track where play is to end.
    href="url" Internet Explorer. Converts sound control file into URL.
    loop="n" Netscape. Specifies if the sound should be played continuously (set loop to TRUE), a certain number of times (a positive value) or not at all (FALSE).
    playcount="n" Internet Explorer. Specifies the number of times to play the sound.
    pluginspace="url" Netscape. Location of software necessary to install the plugin file. Only needed if the plugin is not a standard one.
    pluginurl="url" Netscape. Location of software necessary to play the sound file. Only needed if the plugin is not a standard one.
    starttime="mm:ss" Netscape. Indicates spot (minutes and seconds) on track where play is to start.
    target="url" Internet Explorer. Converts sound control file into URL.
    volume="n" Netscape. Controls volume of the sound. Can be from 0 (off) to 100 (full volume).
    hidden="value"

    Defines if the object shows on the page. FALSE means no and TRUE means yes.
    height="n"

    Height of the object in pixels or en.
    NAME="name"

    A name used to reference the object.
    SRC="url"

    URL of the object to be embedded. This can be any recognized (by the client system) sound file (.midi, .wav and so on).
    units="x"

    Indicates how to measure the units.

    pixels The default - measure in pixels.
    en Measure in en spaces.
    width="n"

    Width of the object in pixels or en.
    "optional parameter"=value

    Any number of optional parameters which are needed by the embedded object. These are totally dependant upon what's required by the object itself.

    Examples:

    This command embeds the movie "mymovie.mov" at the current location with a window which is 100 by 100 pixels.