Publishing > Customizing HTML publishing templates > Creating an image map

 

Creating an image map

Flash can generate an image map using any image and maintain the function of buttons that link to URLs, even if another image is substituted. On encountering the $IM template variable, Flash inserts the image map code in a template. The $IU variable identifies the name of the GIF, JPEG, or PNG file.

 
To create an image map:

1

In the Flash document, select the keyframe to be used for the image map and label it #Map in the Frame Properties inspector (choose Window > Properties if the Properties inspector is not visible). You can use any keyframe with buttons that have attached Get URL actions.

If you don't create a frame label, Flash creates an image map using the buttons in the last frame of the movie. This option generates an embedded image map, not an embedded Flash movie.

2

To select the frame to be used for displaying the image map, do one of the following:

For PNG or GIF files, label the frame to be used for display as #Static.

For JPEG, during the publish operation, place the playhead on the frame to be used for display.

3

In an HTML editor, open the HTML template you'll modify. Flash stores HTML templates in the Macromedia Flash MX/HTML folder.

4

Save your template.

5

Choose File > Publish Settings, click the Format tab, and select a format for the image map—GIF, JPEG, or PNG.

6

Click OK to save your settings.

As an example, inserting the following code in a template:

$IM
<IMG SRC=$IS usemap=$IU WIDTH=$IW HEIGHT=$IH BORDER=0>

might produce this code in the HTML document created by the Publish command:

<MAP NAME="mymovie">
<AREA COORDS="130,116,214,182" HREF="http://www.macromedia.com">
</MAP>
<IMG SRC="mymovie.gif" usemap="#mymovie" WIDTH=550 HEIGHT=400 BORDER=0>