Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Label dataChange event not getting fired

<mx:Label id="myLabel" dataChange="{trace('changed!!');}"  />

I change the text in the above label:

myLabel.text = "new text";

But nothing is traced as it's supposed to.

Am I using a wrong event? I thought dataChange is fired when text in the label is changed.

like image 250
Yeti Avatar asked Dec 30 '25 00:12

Yeti


1 Answers

The event you want is valueCommit. The dataChange event is specific to the data property, not text.

<mx:Label id="myLabel" text="1" valueCommit="trace('changed')" />
<mx:Button label="Click Me" click="myLabel.text += '1'" />
like image 56
Samuel Neff Avatar answered Jan 01 '26 18:01

Samuel Neff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!