In my question to minimize memory requirements in XML, I’d like to optimize the
zero index accessor.
Right now, we have Object.defineProperty in the XML constructor. The byproduct
of that is we have a function defined on every single instance of XML. Ideally
that should be on the prototype object. This should drastically reduce the
memory requirements for instantiating XML.
In JS, that’s pretty easy to do:
Object.defineProperty(thePrototype,"0",
{
"get": function(){return this},
"set": function(){},
enumerable: true,
configurable: true
}
);
I’m struggling with how to do it in AS3. How can we get a reference to the
prototype outside the constructor or have the compiler construct this kind of
function automatically?
Thoughts?
Harbs