My question is about memory use and objects in actionscript 2. If I have a class definition:
class test1{
public function one(){trace("Hello");}
public function two(){trace("World");}
}
And a second class definition:
class test2{
static public function one(){trace("Hello");}
static public function two(){trace("World");}
}
And then I do the following:
var object1a = new test1();
var object1b = new test1();
var object2a = new test2();
var object2b = new test2();
Is the size of object1a + object1b greater than the size of object2a + object2b because of the functions not being static (and possibly being copied into each object instantiation)? I do not have Actionscript 3 to detect memory use, maybe someone can check how this behaves in AS 3 if it is difficult to determine in AS 2.
I'm just wondering if non-static member functions are all references to the single prototype definitions, or if they are copied wholesale into each function effectively doubling memory use for test1 vs test2. I imagine they are treated as references and then overriding them simply changes the reference to a different function in memory, but I am not sure and would like a bit of clarification.
Thanks!