function onConstructed() { var myObject = new Object; scene.addDOMObject("foo", myObject); } function onClose() { scene.removeDOMObject("foo"); }