Hi.
On Sun, Nov 30, 2008 at 10:11 AM, Dave Kong <[EMAIL PROTECTED]> wrote:
> Isn't "height" the "dynamic property" of another "dynamic property"
> this["something"] (which is equivalent to this.something)?
I wouldn't exactly say it like that. Dynamically accessing a property of an
object using the [] operator (as opposed to using the dot syntax) has some
special implications, the most important being type checking, both at
compile-time and at run-time.
If you have something like,
package
{
public class Whale
{
public var lung:Lung;
}
}
the compiler will rightfully choke if you tried to do something like
var humpback:Whale = new Whale();
humpback.lung = new Gill();
But it wouldn't be able to notice if you did it like this:
humpback["lung"] = new Gill();
or
humpback["leg"] = new HairyLeg();
There, you'd get your type coercion and property errors only until runtime.
It does have its rightful uses, of course, and you might want to check about
dynamic classes, etc. but you should be mindful about them.
gabriel.
--
gabriel montagné láscaris comneno
http://rojored.com
t/506.8367.6794