[LON-CAPA-users] physlet code

lon-capa-users@mail.lon-capa.org lon-capa-users@mail.lon-capa.org
Thu, 15 Sep 2005 16:11:05 -0400 (EDT)


I've been poking at the physlet code a little more and find that the 
following is the scheme which does not work:

<script language="JavaScript">
var timerID=0;
var loaded=false;

function initApplets(){
     clearTimeout(timerID);
     loaded=true;
     timerID=setTimeout("mass()",100);
}


function mass(){
     if(!loaded) return;
     timerID=0;

     document.Animator.setAutoRefresh(false);
     document.Animator.setDefault();

..... bunch of code .....


<applet vspace="0" width="600" archive="Animator4_.jar,STools4.jar" 
align="middle" name="Animator" height="200" mayscript="mayscript" 
hspace="0" code="animator4.Animator.class" codebase="../classes">
   <param value="true" name="ShowControls" />
   <param value="0.05" name="dt" />
   <param value="10" name="FPS" />
   <param value="10" name="PixPerUnit" />
   <param value="0" name="GridUnit" />
   <param value="initApplets()" name="onLoad" />
</applet>


If I just have the mass routine and a button to use to start it, it seems 
to work.


Any thoughts?

Mark



----------------------------------------------------------------------------
Mark Lucas					email: lucasm@ohiou.edu
252D Clippinger Lab  				phone: (740)597-2984
Department of Physics and Astronomy             fax:   (740)593-0433
Ohio University
Athens, OH 45701