views:

22

answers:

1

Hello, I've a question about variables in AS3 OOP. Do I have to set them to null or I it's not needed when I define them in beginning of the class? I just noticed someone doing so so I wasn't sure is it right or no.

private var _mcComponentHolder:MovieClip = null;
private var _mcComponentHolder:MovieClip; 

Thanks in advance!

+2  A: 

I think either of those is fine. I've never bothered declaring it as null.

meman32
An object will always be `null` before instantiation.
nikc
Thanks nikc, I will removed the null declaration then. :)
Richards