From: CJRandall <colin@shieldwolf.demon.co.uk>
X-Complaints-To: abuse@demon.net
Subject: Re: ascii animation HELP!
Date: Sat, 29 Aug 1998 23:46:59 +0100
-
Re ascii animation HELP!.nws
INFO:

In article <35D500DF.524D@iNOdirect.ca>, llizard <llizard@iNOdirect.ca> writes
>
>Because of this newfound knowledge, I have now added a second part to my
>template. It can be found at
>
>http://www.geocities.com/SoHo/Studios/9334/animlesson2.htm#top
>
>
           -=oO[  2 Java-Anims on 1 page!  ]Oo=-

<-quote->
>
> Oh yes, one more thing:
> You can only have one Javascript animation running per page.
>
<-unquote->


[][ hi ...

  i got an error code when loading 'animlesson2.htm' into ms.Ie4  :(
  ... it complained of 'object not found' ...

  ... to get it to show the two anims on the same page i adjusted the
      anim-code slightly so that it would show prop'ly.

  it now seems to be fixed for ms.Ie4 ... but i dont know if the fix
      has broken it (the anims) for other browsers?

[][ here is the just the active script section ... (crude patched) ...

--------8<------cut-here-------8<---------
<HTML>
<HEAD>
   <TITLE>optimizing your Javascript ASCII-animation</TITLE>
</HEAD>
<body bgcolor="#FFF6E9" text="#800000" link="#008000" Alink="#0000FF"
Vlink="#008080" onload="ticker()">

<a name="top"> </a>
<h1>Optimizing your Javascript ASCII-animation</h1>
</center>

<p>Perhaps your animation has similar lines in each frame. You can optimize it
and substantially reduce the size (always a good thing) making it much faster
 to load.</p>
<center>
<b>bird singing</b> --ejm98
<script language="JavaScript">

function ticker()
{
        tick();
        tock();
}

    var max=0;    
function tlist(){ max=tlist.arguments.length;
        for(i=0;i<max;i++) this[i]=tlist.arguments[i];
    }
    tl = new tlist(

"   \<\")        \r\n"+
"   ( \>\\       \r",

"   \>\")        \r\n"+
"   ( \>\\       \r"

    );
    var x=0;
    function tick() {
        document.f.t.value=" \r\n"+
        tl[x]+
        "    \" \\\\     \r\n"+
        "       \\  ejm98\r";
        x++; if(x==max) x=0;
        //if(confirm('continue?'))
            setTimeout("tick()",70);
    }
    //--></script>
<FORM NAME=f><TEXTAREA NAME=t ROWS=6 COLS=17>
</TEXTAREA></FORM>


<script language="JavaScript">
    var mox=0;
    function tlost(){ mox=tlost.arguments.length;
        for(i=0;i<mox;i++) this[i]=tlost.arguments[i];
    }
    tol = new tlost(

" \r\n"+                    
"         ___\r\n"+  
"       _/   |   z\r",

" \r\n"+
"         ___     z\r\n"+
"       _/   |\r",

"                   z\r\n"+
"         ___ \r\n"+
"       _/   |\r"

    );
    var ox=0;
    function tock() {
        document.of.to.value=tol[ox]+
        "      |_____| ===-^^\>\r\n"+
        "        --- ==    \\/ \>\r\n"+
        "      [_____]      __\>,^\r\n"+
        "ejm    |   |      //| |\r";
        ox++; if(ox==mox) ox=0;
        //if(confirm('continue?'))
            setTimeout("tock()",250);
    }
    //-->
</script>
<FORM NAME=of><TEXTAREA NAME=to ROWS=9 COLS=27>
</TEXTAREA></FORM>
</center>

</BODY></html>
--------8<------cut-here-------8<---------

ps: fanx for the useful info. on optimisation
pps: sorry about the <HEAD> duplication in e-mail :(

[][ see yuz
[][ colin
-- 
( () /_ / /\)   _/   /? .\ /\) /) .\ /_ /_
CJRandall http://www.shieldwolf.demon.co.uk
