I made a non generic animation applet for the sole purpose of having my own customized web greetings card.
After some people saw it, it came to my mind that it could be useful to have a generic version in case me or anyone else wanted to do the same in the future, so I rewrote the code to allow the complete parametrization of the animation.
The final result is an applet that loads an animation script that describes the animation elements and steps.
Before the animation can be run, all files must be loaded, so the applet shows a "Loading" text while it can't show something better.
If the "loading" image finally gets loaded, the applet shows it instead.
Once all animation frames are ready, the applet starts the animation.
Music files are expected to be MIDI files terminated by ".mid".
Audio files are expected to be Sun's AU files terminated by ".au".
I REALLY tried to be compatible with those freaking discontinued M$ JVMs, but as they froze on Java 1.1 it's impossible to load MIDI files and the resultin animation gets quite ugly. So please, install a DECENT Java Plug-In!
Images may vary. I didn't test it, but I suppose it would support GIF files. Better not try something slightly fancier such as PNG, though. You never know what the end user's Java Plug-In will do with that.
For further description, check the files below.
<applet code=Animator.class archive="animator.jar" width="640" height="480"> <param name="script-file" value="script.properties"> <param name="image-prefix" value="anim"> <param name="image-suffix" value=".jpg"> <param name="music-prefix" value="music"> <param name="sound-prefix" value="sound"> <param name="image-loading" value="loading.jpg"> </applet>