    Contents    Previous    Next

#### Adding an Applet to a Page

# Performing Animation

The ImageLoopItem applet lets you put animation into an HTML page. When someone visits the page containing the animation, the animation plays continuously for as long as the page is visited. By default, the animation pauses whenever it displays the first frame.

To put an animation into an HTML page:

1. Create a series of pictures, with one picture per "frame" of animation. An animation sequence can contain up to 40 pictures in a row.
2. Save each picture as a GIF (Graphics Interchange Format) file. Name the files T1.gif, T2.gif, ... (where T1.gif is the first picture in the sequence, T2.gif is the second, and so on).
3. Create a directory (folder) in a place that can be published -- for example, at the same level as the HTML page that will display the animation.
4. Put the GIF files in the directory.
5. Add the animation to the HTML page, using the `APP` HTML tag. For example, if the files are in a directory named MyCartoon at the same level as the HTML file:

       <APP CLASS="ImageLoopItem"
            SRC="doc:/demo/"
            IMG="MyCartoon">

To make the animation repeat without pausing, specify the `PAUSE` attribute with a value of 0. For example, the animation playing at the top of this page (if you're using HotJava) was specified with the following:

      <APP CLASS="ImageLoopItem"
           SRC="doc:/demo/"
           IMG="images/jon"
           PAUSE=0>

    Contents    Previous    Next