Reputation: 6831
I've done a data-binding following a tutorial on the web:
<mx:Script><![CDATA[
public static const selectedChild:Boolean = true;
]]></mx:Script>
<mx:Button label="{resourceManager.getString('resources', 'button.startLab')}"
id="nextStepButton" enabled="{selectedChild}" />
My question is how we can accsess this bindable variable from another mxml file?
Thanks.
Upvotes: 0
Views: 216
Reputation: 59471
As already stated, you can access selectedChild
from another class using ClassName.selectedChild
, where ClassName
is the name of your mxml file.
Please note couple of things though:
selectedChild
is not declared as bindable. You should use the [Bindable]
metadata tag to make a variable declared in actionscript to be bindable.selectedChild
is declared as const
, meaning its value cannot change in between. Thus, you need not use data binding on that field - just assign the value to the enabled
field of the button once it is created.Upvotes: 1