Adobe ATMOSPHERE User Manual page 316

Table of Contents

Advertisement

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
// Relative URLs
fl y1
fl y2
fl y3
fl y4
fl y5
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' fl ag will properly wait for the 'ViewpointObject.loaded' fl 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()
= SceneGroup("http://www.myDomain.com/myHomePage/spider.aer");
= SceneGroup("./fl y.aer");
= SceneGroup("../fl y.aer");
= SceneGroup("../../fl y.aer");
= SceneGroup("./bugs/fl y.aer");
= SceneGroup("/fl y.aer");
// current folder
// up one folder
// up two folders
// in the folder called bugs
// in the root folder

Advertisement

Table of Contents
loading

Table of Contents