I can see it's a good principle to not have heavy constructors. But does anyone know if this the message about the compiler not compiling constructors is actually true?
"HeavyConstructor. Constructor must be as lightweight as possible. No control statement allowed, whereas a cyclomatic complexe of 2 has been detected. The Just-In-Time compiler does not compile constructors. Make them as lightweight as possible, or move the complexity of the code to a method called by the constructor. Then the complexity will be compiled by the JIT"
Here is a white paper from Joa:
http://www.google.com/url?sa=t&source=web&cd=3&ved=0CB0QFjAC&url=http%3A%2F%2Fje2050.joa-e bert.com%2Ffiles%2Fmisc%2Fas3opt.pdf&rct=j&q=flash%20player%20constructor%20jit&ei=8eTGTOj eEIjUtQOe4uTNDQ&usg=AFQjCNE5td-Jv8iUuYVY3cLlY1zBc3SU6Q&sig2=qE3PN3SnBJauVDC4ZMUt2Q&cad=rja
Thanks. Very interesting. The ActionScript JIT compiler doesn't optimise code within constructors. Perhaps change the warning message to say "does not optimise code in constructors" rather than "does not compile constructors"?