Testing Inside a Web Page

In addition to letting you test your animation in Flash Player, Flash lets you test your animation embedded in a web page. This option lets you see how your animation looks in a web browser based on the animation alignment, scale, and size options Flash lets you set.

Here's how it works. You tell Flash in the Formats tab of the Publish Settings window (Figure 19-4, left) that you want to embed your animation in a web page. Then, in the HTML tab, you tell Flash how you want your animation to appear in the web page (Figure 19-4, right). When you choose File→Publish Preview→HTML, Flash constructs an HTML file containing your animation, and then loads it automatically into the web browser on your computer.

Left: Flash gives you several publishing options, one of which is embedding your animation into an HTML file.Right: Flash constructs an animation-containing HTML file based on the options you choose in this tab. The name Flash uses for your HTML file is the name of your Flash document, but with an .html extension.

Figure 19-4. Left: Flash gives you several publishing options, one of which is embedding your animation into an HTML file. Right: Flash constructs an animation-containing HTML file based on the options you choose in this tab. The name Flash uses for your HTML file is the name of your Flash document, but with an .html extension.

Note

Tucking your animation into a web page is the most popular publishing option, but it's not the only one Flash has. The other publishing options, including publishing your animation as a QuickTime movie and as a standalone Flash projector file, are covered in detail in Chapter 20.

To test your animation inside a web page:

  1. Choose File→Publish Settings.

    The Publish Settings dialog box in Figure 19-4 (left) appears.

  2. Make sure the "HTML (.html)" checkbox is turned on, and then click the HTML tab.

    Flash displays the contents of the HTML tab shown in Figure 19-4 (right).

  3. Click the Template drop-down menu, and then choose "Flash only." Click OK.

    Flash accepts your changes and closes the Publish Settings dialog box.

  4. Choose File→Publish Preview→HTML.

    The Publishing dialog box appears briefly to let you know Flash is creating an HTML file. When the dialog box disappears, Flash loads the completed HTML, including your embedded animation, into the web browser on your computer (Figure 19-5).

In addition to creating an HTML file, choosing File→Publish Preview→HTML launches your web browser preloaded with that file.

Figure 19-5. In addition to creating an HTML file, choosing File→Publish Preview→HTML launches your web browser preloaded with that file.

Right-clicking (Windows) or Control-clicking (Mac) the running animation shows you standard menu options you can use to control playback inside the browser, although how many options you see depends on whether you turned off the checkbox next to "Display menu" in the Publish Settings dialog box.