User Guide

304 APPENDIX E
theStage
The loaded world’s SceneGroup. Provides access to all objects and elements in the base scene. Note that it is not
possible to set an object property to be theStage. You must use the ‘theStage global if you need to access theStage
in a script.
numSolidObjects = theStage.getSolidObjectCount();
numViewpointObjects = theStage.getViewpointObjectCount();
chat.print((numSolidObject + numViewpointObject) + “ objects in the world.”)
theWorld
The top level SceneGroup containing all objects in the current Atmosphere instance, including theActor.
Provides access to all objects and elements in the scene.
myCoolObject = theWorld.getChild(“coolObjectName”);
Global Methods
SceneGroup(url)
The SceneGroup constructor, it loads an Atmosphere world fi le from the given URL and returns it as an object.
Just like Web links, SceneGroup URLs can be either relative or absolute. Note that the SceneGroup is not visible
(rendered) until you use the local add() method shown below.
// Absolute URL
spider = SceneGroup(“http://www.myDomain.com/myHomePage/spider.aer”);
// Relative URLs
y1 = SceneGroup(“./fl y.aer”); // current folder
y2 = SceneGroup(“../fl y.aer”); // up one folder
y3 = SceneGroup(“../../fl y.aer”); // up two folders
y4 = SceneGroup(“./bugs/fl y.aer”); // in the folder called bugs
y5 = SceneGroup(“/fl y.aer”); // in the root folder
Properties
type
The object’s type. Returns “SceneGroup.
if (foo.type == ‘SceneGroup’) { ... }
loaded
This fl ag is true once the SceneGroup has fi nished loading. Note that if a SceneGroup contains
ViewpointObjects, the ‘SceneGroup.loaded’ ag will properly wait for the ‘ViewpointObject.loaded’ ags to
become true only under the following conditions:
The SceneGroup is in the fi rst level directly under the ‘stage’ in the Scene Hierarchy.
The SceneGroup was added to the scene by a Javascript calling the .add()’ function.
box = SceneGroup(“./box.aer”);
box.timestep = function()