The most common question is.... How? Well my friend, it is simple! All you need to do is draw a few frames of ascii art to be animated, and then slap it between some javascript :)
How the hell do I draw frames of ascii art?? Well that's a longer story. I guess ya just got it or ya don't!
Okay, so how do I write the Javascript? Well, good news! Ye don't!! I've done it :) Just use this:
<script language="JavaScript"> <!-- Begin animation --- var frame_count=0; var nl="\r\n"; function Animate() { document.animation.viewer.value = cartoon[frame_count]; if (cartoon[++frame_count]==null) frame_count = 0; // Remove "//" from start next line to show it a frame at a time. // if(confirm('continue?')) setTimeout("Animate()", 100); // Change number here to change speed } var cartoon = new Array( This is where you shall put your animation, with the following modifications:First, in this order:
Problems: When the animation gets large, maybe around 30 kilobytes (it's unknown exactly what size), the javascript will start producing errors for some reason on 16 bit netscapes. You can fix this by splitting the animation into separate variables. This involves replacing this line:
if (cartoon[++frame_count]==null) frame_count = 0;
with:
if (cartoon[++frame_count]==null) { // Switch cartoon variables. var temp=cartoon; cartoon=next; next=temp; frame_count = 0; }
If splitting the variable into two still doesn't work... keep going. All you need is to slightly modify the "switching cartoon variables" line in the javascript for each additional split.
This sounds like a lot of work!! Heeeeelp me?? Well since you asked, there's a program which does all of this for you :)
I have also made a small program to help you test your frames before converting them to hypertext. It's just a small DOS program that animates the frames
Hint: This method can also be used to display a flasing text message. (If it's only one line, change the TEXTAREA to an INPUT tag)