User Guide
ADOBE ATMOSPHERE 247
User Guide
* See the examples elsewhere on the Atmosphere website to demonstrate this behavior in more detail. The
example can be downloaded and examined or customized for your particular application.
// Open the URL in a browser window
sendJS(“window.open (‘http://www.adobe.com’, ‘’, ‘’);”);
// Pop up a JavaScript alert window
sendJS(“alert(\”Hello World!\”);”);
// Update a webpage form checkbox with the Atmosphere current state
sendJS(“document.forms[‘myForm’].chatPaneVis.checked = “ + application.chatPaneVisible);
$.gc()
This global method will force JavaScript memory “garbage collection”. More clearly, at regular intervals, the
Atmosphere JavaScript processor performs memory reset and update for variables and objects which have
been deleted in the JavaScript code. When large amounts of processing occurs using objects and variables of
*identical* names, the objects or variables may be recreated prior to being deleted by the normal Javascript
cleanup routine. If you experience errors under these conditions, you may insert this “garbage collection”
method into your routine to ensure that the reused objects and variables were properly deleted prior to being
reused.
//delete and recreate a new array of box SceneGroups
function deleteBoxes()
{
//delete the fi rst group of boxes
for ( i=0; i<50; i++ )
{
delete boxes[i].SceneGroup;
}
//force memory clean up
$.gc();
//recreate a new box array
for ( i=0; i<50; i++ )
{
boxes[i].SceneGroup = SceneGroup(“./box.aer”);
}
}
Callbacks
timestep(t, deltaT)
This function is called each frame with the current time in seconds that has elapsed since the world was entered.
In worldInit.js the list of animators is traversed by this callback which in turn calls the timestep functions for
each of the animators.
Use custom timesteps to accomplish animated behavior, such as moving an object from one location to another
over a specifi ed duration. Creating custom timesteps require an object as a reference. For in-depth examples on










