Yeti
Yeti

Reputation: 5818

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.

Upvotes: 3

Views: 1844

Answers (1)

Samuel Neff
Samuel Neff

Reputation: 74909

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'" />

Upvotes: 2

Related Questions