There are two main pieces to any DirectAnimation applet, the DXMApplet class and the Model class. To use the DirectAnimation classes, import the media libraries like this: |
Call AppletContext() and set _getAppContext to its return. _getAppContext will be used to call showDocument(). |
Then create a class that extends the Model class. In this class the createModel method is where you construct your animation. This example will make use of two of the primary media types supported by DirectAnimation: images and sound. |
Create bases for importing images and sounds. |
Import seattle.jpg. |
Import the sound that will be played when the mouse moves over seattleImg. |
Make seattleImg pickable. |
Create an event that will trigger when the mouse moves over detectImg. |
Get the image part of pickPImg. |
Create a string that contains the URL to Seattle Sidewalk. |
Create the tip box (tipImg), which consists of a black backgroud (tipBackIm), and white text (tipTxtIm). |
Create a detectable image (jumpImg)and crop it to 6 by 6 mm. This image will be made pickable and used to jump to Seattle Sidewalk. |
Make detectImg pickable. |
Create an event that will trigger when the mouse moves over jumpImg. |
Create an event that will trigger when both the mouse moves over jumpImg, and the left mouse button is clicked. |
Get the image part of jumpPImg. |
Combine the pickable images with the tip box and pair them with sound. |
Create a behavior (pickTup) that start out as a detectable empty image with no sound. When the mouse moves over it, the sound changes to pickSnd, and the tip box is displayed. When the mouse is no longer over it, it returns to the original behavior. |
Create a behavior that starts out as pickedTup, and that jumps to the Seattle Sidewalk site when the user clicks on pickPImg using the left mouse button. |
Display the final image. |
Start the sound. |
Convert urlStr into an URL. |
Use the Java showDocument method to load the Seattle Sidewalk page in the parent frame. |
Return currentRunningBvr to keep the UntilNotify happy. |
Thats all there is to it. Happy animating... |