If I understand what you mean I don't think it's possible. Until the constructor finishes the child object does not exist, so you can't pass it to super()
inside a constructor. Even worse, until super()
is called base classes are not set up. In particular the Object
which is base to all classes in Actionscript and so needed for them to work.
I was reminded of this reading that Java discussion. Like Java (and unlike C++) every object in Actionscript derives from a base class, Object
. For a simple class, i.e. one not part of a hierarchy, it will insert the call to the constructor to Object
at the start of the class's constructor.
This makes it much more complicated for derived classes. If you can call super()
anywhere in the constructor, then anything before that call not only can't refer to the yet to be created parent object, but can't use any of the properties of the Object
class. You can see why it makes sense to enforce constructing the parent object before everything else.