Is it "better" to initialize AS3 class variables in the class constructor? Or can I just initialize them to their default value when I declare them at the top of my class? I ask because when there's a lot of class variables, it appears inefficient to declare them in one place and then initialize them in another when I could easily do both in the same place. It one option is better than the other, why?
Thanks!
eg:
initializing in constructor
class foo {
var bar:Boolean
}
function foo():void {
bar = true;
}
OR
initializing with the declaration
class foo {
var bar:Boolean = true;
}
function foo():void {
}