ryanm wrote:
> You do know that it (this.) is being added for you at compile time in
AS2, right?

Who cares? All that means is that there is no semantic difference between the two.

Not quite. What it means is that the "this" is assumed, which is not always what you want.

You can force class scope by including "this", but there's no way to do the opposite. Local (or class) scope always obscures global scope, that's just a fact of life. The only exception is built-in function like trace and eval, which normally obscure everything else. That's probably part of the reason AS3 is more heavily based around namespaces - you can more clearly state what scope you want if everything resides in a unique namespace. That takes us back to the point about whether you should include "this" everywhere - doing so is akin to including the fully qualified name of every class instead of just importing the package. Which is easier to read?

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

Reply via email to