Creating AS3 objects from C++ code is archieved by calling
and alike. getInstanceS calls
ASString* s = new ASString("someString")
ASString::_constructor(/obj:/ s,/args:/ NULL, /numArgs:/ 0)
Actually, the call to _constructor without parameters should initalize s->data = "" (just as AS3 code 'var s:String = new String()' would do), but we use a hack to leave data unchanged in that case.
We should not call _constructor in getInstanceS. Then the _constructor will only be run when constructed from AS3 code.
On the other hand, it may be unexpected to new developers that the _constructor is not run in all cases.
Therefore we should make sure that getInstanceS() with parameter is only allowed for a small set of builtin classes like
ASString, Number, Integer, UInteger, Boolean, Event, Error.
Comments please :-)
I agree that _constructor should not be called from getInstanceS. It's also a good idea to put a large commend above getInstanceS to remind that _constructor will not be called.