Creating an image map

Flash can generate an image map to display any image and maintain the function of buttons that link to URLs. When an HTML template includes the $IM template variable, Flash inserts the image map code. The $IU variable identifies the name of the GIF, JPEG, or PNG file.

To create an image map:

  1. In your Flash document, select the keyframe to be used for the image map and label it #Map in the frame Property inspector (select Window > Properties if the Property 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 SWF file. This option generates an embedded image map, not an embedded Flash SWF file.

  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 following location: <boot drive>:\Program Files\Macromedia\Flash MX 2004\<language>\First Run\HTML.
  4. Save your template.
  5. Select 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.

    For 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>