All that to say, if your going to be putting "this" in front of every class member in AS2 and in AS3 you'll be missing the neat advantage of simplicity.

As it were, the classes I write are rarely self-referential. Properties such as position, visibility, etc, are usually handled elsewhere or by other means rather than directly referring to itself, so you won't find "this" in my code a lot either. When it does appear it is the rare exception, not the rule, but by the same token, you also won't find referenceless method calls either. I very, very rarely put something like "this._visible=false;" in a constructor, and usually only because it's a quickie, one-off project that won't need to be maintained, and even if maintenance is required, there is usually only one class to deal with and everything is right there. But when I do something like that, I always use "this", just so that it's clear what I'm referring to.

You also rarely find _parent references in my code, because usually when I need a reference to the parent, I pass that reference in at creation time and store it as a member variable in the class. If it's not important enough to be a member of the class, then it probably isn't necessary, and if it's necessary, it's important enough to be a member. So really, "this" is the only

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

Reply via email to