http://haxe.org/doc/snip/initialization_of_statics
Unlike in AS3, it doesn't look like you can have unlabeled brackets in the beginning of a class to put static initialization code.
Here is a way to statically initialize something:
public static var NUMBERS = {
var a = new List();
for (i in 0...10) a.add(i);
a; // result of last block expression is saved in NUMBERS
}
No comments:
Post a Comment