Hi Bob,

The script is loaded using a jmolbutton (there are two different
scripts/animations I want to be able to run which will have different
messages to send to the textbox). The animation is then controlled by a
series of additional jmolbuttons allowing the user to play, play reverse,
ahead or back one frame, etc. (basically a set of animation controls similar
to media player or quicktime).

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?

Thanks, Rick



> Rick, this Jmol script is being run when? When there is a frame change? 
> How are you setting it up to run these statements?
>
> In the latest version of Jmol you can designate a Jmol script to be run >>
> from an animation frame callback:
>
>    set animFrameCallback "script:if(_modelNumber = 1);.........."
>
> thus avoiding all JavaScript entirely, but I don't think that's what you >
> are doing, right?
>
> Bob
>
>
> rspinney wrote:
>
>>I am trying to use the if statement to run scripts during an animation 
>>(using version 11.1.36) using the following script (where the messages 
>>are directed to a textbox using the jmolsetcallback function, I want to 
>>change the message based on the model number):
>>
>>if (_modelNumber = 1); message (This is an E1 reaction); endif; if 
>>(_modelNumber = 10); script SCRIPTS/sub1.txt; endif;
>> 
>>The first if statement executes correctly, but the second one never 
>>executes, although it will run correctly using the console. To test 
>>this I
>>added:
>>
>>set echo top right; color echo red; echo "This is model 
>>%{_modelNumber}";
>>
>>which works, displaying the correct model number as the animation
proceeds.
>>But for the if statement it is like the _modelnumber is never updated 
>>when the animation is running. Is this a bug? Is there a better way to do
this?
>>
>>Help!
>>
>>Thanks, Rick
--------------------------------------
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