User Guide
248 APPENDIX E
the use of the timestep method, follow the “Javascript Workshops” link at the Adobe Atmosphere website. (Please
also note that there is a default function present for the timestep(t, deltaT) method in the “worldinit.js” fi le, and
it is not recommended that you change this behavior).
box = SceneGroup(“./box.aer”).add();
box.timestep = function(t, deltaT)
{
box.orientation = Rotation(‘y’, t);
}
addAnimator(box);
onLoad()
This function is called after the last and fi nal JavaScript fi le associated with the world has been loaded and run.
In worldInit.js this event is used to wait for scripts to be loaded before testing whether animators need to have
their onLoad methods called. This is done when their “loaded” fl ag transitions from false to true.
The onLoad() method can be used to initialize objects as they load. Creating a custom onLoad() callback
requires an object as an animator. Note: the addAnimator function must be used in order to enable the onLoad
callback function. (Please also note that there is a default function present for the global function onLoad() in
the “worldinit.js” fi le, and it is not recommended that you use this as a global function name in a script.)
box = SceneGroup(“./box.aer”).add();
box.onLoad = function(now)
{
chat.print(“onLoad called at: “ + now);
}
addAnimator(box);
Application
Application
The Application module is is used to communicate with elements of the user interface. These include the keyboard
and mouse buttons, which may be read. There are also fl ags that control the visibility of the chat pane and the toolbar,
both of which appear in the Player window. The Application module also maintains an array of View objects that each
represent a 3-D rendered view of the current world. (Currently there is exactly one such view.)
Global Properties
application
This global variable stores a reference to the object that represents the application.
// Print out properties associated with application
dump(application);










