JavaScript API Example: registerAddListener()

Here is the code which:[br][list=1][*]Registers the listener function (called "listener")[/*][*]Each time an object is made, adds it to the list (if it's a Point).[/*][/list][br]Using [code]SetValue[][/code] makes the list static. You could use [code]Append[][/code] if you want a dynamic list instead
function ggbOnInit() {[br] ggbApplet.registerAddListener("listener");[br]}[br][br]function listener(obj) {[br] if (ggbApplet.getObjectType(obj) == "point") {[br] ggbApplet.evalCommand("SetValue[list, Length[list] + 1, " + obj + "]");[br] }[br]}

Information: JavaScript API Example: registerAddListener()