>jmolScript('set animframecallback "testanim" ')
>
>and then have:
>
>function testanim(app,frame,p3) {
> jmolScript("if(_modelNumber = 5);message is5;else;message not5;endif") }
>
>I do get the messages expected. So I think that is working properly.
>
>
>Bob

I couldn't use this as is, but it gave me an idea that worked. Thanks! I use
the following to send the script to the applet. 

document.slider1form.jmolApplet0.script("message (Step 1: protonate the
alcohol);");

I have notice that this only seems to allow one statement to be executed.
What I would like to do is pause the animation for a few seconds after a
message is changed so the user has time to read it, i.e.

message (Step 1: protonate the alcohol); delay 5;

But the delay is not executed. (pause and resume don't work either). Any
ideas?

Thanks, Rick


>I am already using animFrameCallback to control a slider which can send 
>a script to the applet. I think it would get fairly complicated to try 
>to also use it to control the messages, especially since I want to have 
>different messages depending on the animation being played. It would be
nice (i.e.
>easiest) if I can control the messages using the statements I described 
>below. Is this possible?
>
>  
>
So you have the animFrameCallback coming to a JavaScript function, and that
function then invokes jmolScript()  or jmolScriptWait() with the commands
listed below? It just seems a bit convoluted, since in that case your
animFrameCallback function already has the model number as one of its
parameters. Wouldn't it be easier just to do it "the old way" 
with the JavaScript selecting a message based on what frame is being
displayed?

What I'm not understanding is what exactly invokes the Jmol script commands
below. Are they part of a jmolScript() command executed from your JavaScript
animFrameCallback function?
So, for example, if I add an animFrameCallback as:

jmolScript('set animframecallback "testanim" ')

and then have:

function testanim(app,frame,p3) {
 jmolScript("if(_modelNumber = 5);message is5;else;message not5;endif") }

I do get the messages expected. So I think that is working properly.


Bob
--------------------------------------
Dr. Richard Spinney
The Ohio State University
Department of Chemistry
160 B Celeste Laboratory
120 West 18th Ave
Columbus, Ohio 43210
 
email: [EMAIL PROTECTED]
 
Phone: (614) 247 - 6847
Fax: 614 - 292 - 1685



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to