I’ve seen something in a few custom classes, tutorials and articles I’ve read as to how people handle their class variables.
Sometimes I see it set up like this:
private var container:Sprite;
private var box:TextField;
And then inside of the constructor and other functions is where they have this:
container = new Sprite();
box = new TextField();
My question is is this just a matter of programming style or is there a reason for doing it this way as opposed to:
private var container:Sprite = new Sprite();
private var box:TextField = new TextField();
Which requires two less lines of code.