How can I script my images? (part 1)

Not only can you modify the appearance of your initial image, you can also put buttons on your web page which allow the viewer call up pre-selected (scripted) views.  The template page has two different types of buttons.  The first is a toggle button which allows the viewer to alternate between two views created by a script and an alternate script.  Double-click the embed tag for the toggle button in the Composer window.  You should see this:

<embed type=application/x-spt | width=15 | height=15 |  button=toggle | target=pdbimage | script="zoom 50" | altscript="zoom 150">

Translationtype=application/x-spt tells the page that this is a Chime button.  The toggle button is 15 pixels high and wide.  Pushing the button affects the Chime image named pdbimage.  When the button is pushed "down", the image will be 50% of original size.  When the button is pushed "up", the image will be 150% of original size.

Modify the button tag so the target matches the desired image file.  You may also wish to enter additional commands to the script and alternate script.  Remember to separate script commands with ; or | or carriage returns.  When done, preview the template page to see if it works. 

A particularly useful script command is move 10 20 30 40 5 6 0 0 3 which means the following:  Rotate the molecule 10, 20 and 30 deg on the x-, y-, and z-axes.  Make the molecule 40% bigger.  Move the molecule 5 units along the x and 6 units along the y axes.  Do all animations simultaneously over a period of 3 seconds. 
 

On to the next page
Back to the outline