secondo me il prob del NAN dipendeva dal fatto di convertie in Numero una variabil non inizializzata
esempio
se lo provi così com'è non da problemi ma se togli queste 2 righe arriva il NaN
num1.text="0"
num2.text="0"
codice:
this.createTextField("num1", this.getNextHighestDepth(), 10, 10, 100, 22);
num1.border = true;
num1.type = "input";
num1.text="0"
this.createTextField("num2", this.getNextHighestDepth(), 10, 30, 100, 22);
num2.border = true;
num2.type = "input";
num2.text="0"
this.createTextField("tot", this.getNextHighestDepth(), 10, 60, 100, 22);
tot.border = true;
tot.type = "dynamic";
var txtListener:Object = new Object();
txtListener.onChanged = function(textfield_txt:TextField) {
tot.text = Number(num1.text)+Number(num2.text)
};
num1.addListener(txtListener);
num2.addListener(txtListener);