JavaScript tutorial:
Looping animation

 

Use your JavaScript Editor to open Rectangle.htm (in the Tutorial folder inside your JavaScript Editor folder) and examine the code. The script demonstrates how to create looping animations.

To run the code click on the Show Internal Viewer button, or
Click here to open Rectangle.htm in the browser.

Observe the four functions used to move the object left, right, up or down, respectively:

moveObjLeft();
moveObjRight();
moveObjUp();
moveObjDown();

Like in the previous example, cpSequencer() is used to control the order of execution.

Next