ryanm wrote:
What I don't get is why it needs "this.addChild" instead of just addChild. I've been sick of the keyword "this" for a long time and have since avoided it in AS2.

Any reason that it needs to be back in for AS3?

Maybe because it's one of the most useful scope references ever invented?

The fundamental concept that you seem to miss is that "addChild" is meaningless by itself, it is a method of an object (in proper OOP development), and if you just say "addChild", who is adding the child?

the context is the current class. Occasionally 'this' is useful if you happen to name a method parameter or local variable the same as a member variable and need to distinguish the two.

But, I dont agree that its bad form to leave it out, nor is it any more difficult to maintain.

in my opinion putting 'this' in everywhere to me just makes things harder to read.

thanks,

Martin
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to