After you create an animation sequence and move it into the appropriate subdirectory, you can code a hot spot in the topic file to display the animation sequence. This hot spot, instead of jumping to a topic or displaying a popup window, executes a Viewer command: the display animation command. This command works much the same as a popup window by displaying a window over the topic while playing the animation sequence in the window. This type of window is called an extended window.
The display-animation command has two parts:
A word, phrase, or bitmap formatted as double-underline text that serves as the activation point for the command
The display-animation command formatted as hidden text
·To code an extended animation window:
1.Display the topic from which you want to display the animation window.
2.Select the text or bitmap reference that you want to serve as the activation point.
3.From the Format menu, choose Character and select the Double Underline check box, then cancel the selection of the text or reference.
4.From the Format menu, choose Character again and clear the Double Underline check box, then select the Hidden check box.
5.Type the display-animation command (see the following section for more information on the format of this command).
6.From the Format menu, choose Character again and clear the Hidden check box.
In its simplest form, the display animation has the following syntax:
!HAnimateCommand(hwndContext, qchPath, "animationfile", "nocontrol", "window title")
Every element of this command must be typed as shown, except for animationfile and window title.
The animationfile is the filename, enclosed by double quotes (“ ”), for the animation sequence you want displayed. Make sure to include the path from the project directory to the animation sequence. Any backslashes (\) in the path must appear as double backslashes (\\) in this command.
The window title is the text you want displayed in the window title bar and must be enclosed by double quotes (“ ”).
Summary: In the Topic File
The USA Tour sample title uses the display-animation command in the Land and People topic for Hawaii follows:
The islands, of volcanic!HAnimateCommand(hwndContext, qchPath, "animate\\volcano.mmm", "nocontrol", "Volcano")...
This command displays the volcano animation when the user clicks the text “volcanic.” The file VOLCANO.MMM in the \VIEWER\USA\ANIMATE directory contains the animation sequence. When Viewer displays the window, the title “Volcano” appears in the title bar of the extended window.
Notice that the reference to the animation sequence includes the path from the project directory (\VIEWER\USA) to the animation file (ANIMATE\VOLCANO.MMM). Notice also that you must enter a double backslash (\\) for each single backslash (\) in the path. The following illustration shows how this entry appears inside the Word topic file:
Summary: Inside the Project File
You must now register the animation window command by placing the following entry in the [CONFIG] section of the title's project file:
[CONFIG]
RegisterRoutine("mvaff", "HAnimateCommand", "USSSS")
Make certain to type the entry exactly as shown above. You only need one entry regardless of how many animation commands you use in your title.
Summary: How it Displays
After the user clicks the bitmap, Viewer displays the animation window (with the animation sequence frozen in the picture), as shown in the following illustration:
Besides activating animation windows from hot spots, you can embed animation sequences in a topic so that they play while the topic is being displayed. You can also create animation sequences with control panels that allow users to control playback. Chapter 8, “Advanced Animation Techniques,” describes these methods in detail.