--- In [email protected], "tntomek" <tnto...@...> wrote:
>
> Is there a way to get a strong property name from an object?
>
> scenario ... Person class having "weight" property
>
> var column:DataGridColumn
> column.dataField = "weight";
>
> can i do something like:
>
> column.dataField = Person.weight.getPropertyName();
>
> ... so that if this "weight" property is renamed one day I would get compile
> time warning?
>
You can look for Person.hasOwnProperty('weight') to see if the property exists
at runtime. If you want a compile-time warning, just put in a hard reference
somewhere to aPerson.weight.
HTH;
Amy