If you want to bind in MXML to some static variable compiler will warn you that data changes to the value will be unnoticed with the following warning:
Data binding will not be able to detect assignments to "SOME_STATIC_VARIABLE".
I don’t like compiler errors and don’t like compiler warnings as well. So, to avoid this warning you can do the following:
Instead of:
<mx:TextInput enabled="{iUserAccessId == GLOBAL.m_iAllowTextInput}" />;
you can do this:
<mx:Script>
<![CDATA[
[Bindable]
private var iCanEdit:uint = GLOBAL.g_iAllowTextInput;
]]>
</mx:Script>
<mx:TextInput enabled="{iUserAccessId == iCanEdit}" />
<![CDATA[
[Bindable]
private var iCanEdit:uint = GLOBAL.g_iAllowTextInput;
]]>
</mx:Script>
<mx:TextInput enabled="{iUserAccessId == iCanEdit}" />
Voilà!
[…] don’t specifically tell to compiler that class Parent is bindable, compiler will give you the infamous warning on the attempt to bind to any public member of the Parent class: Data binding will not be able to […]
Thanks, this really helped.
BTW, the source windows are quite narrow, and therefore distracting. (I checked both IE and FF.)