I have a label that get it’s value from a var when you click on a button. The var has already been declared:
public function clickevent
{
label.text = aVariable;
}
Now I know that if i have a label like this:
<s:Label id="label2" text="{aVariable}"/>
and aVariable is empty, label2’s text is Null (it doesn’t give an error, just “Null” in my situation). This is my current situation.
What I’d like to know is when I later on change the aVariable’s value to a string “hasChanged”, for example. The label2’s text should also change to “hasChanged” without the user having to push a button or anything to make this change. How can this be done?
I’m not 100% sure I understand your question but if your variable is declared as “bindable”, no matter if your script change its value or a button, your text propertie of the label will follow as it is binded.