Adding Flash to a Web Page

Flash movies are generally added to web pages using a combination of the <object> and <embed> tags with parameters and attributes for controlling display and playback. Both tags are used in order to accommodate the incompatibilities of Internet Explorer and Netscape Navigator. Internet Explorer on Windows uses the <object> tag, which enables it to automatically download the ActiveX controls for playing Flash media. Navigator (on Windows, Mac, Linux, and Solaris) and Internet Explorer on the Mac understand the <embed> element for Flash placement.

You can either generate the HTML using Flash’s Publish feature or write it out by hand. This section takes a look at both methods.

Using Flash Publish Settings

The easiest way to get your SWF files on the Web is to let Flash do the work for you. Flash 4 introduced the “Publish” feature for exporting movies along with automatically-generated HTML for placing it in an HTML document. The built-in Publish function replaces the AfterShock utility used with previous versions of Flash.

The Publish Settings dialog box also allows you to select the export format of the movie (whether it’s to be a Flash movie, Generator template, static graphic format, and so on) and control the variables of the export. For now, we’ll focus on the HTML settings that are relevant to placing an SWF movie on a page.

The most welcomed feature of the HTML Publish Settings is the collection of pre-formatted templates that generates <object> and ...

Get Web Design in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.