tempo fa avevo scaricato il fla di un termoconverter
che tramite due InputText(cDeg & fDeg) trasorma da °C a °F e viceversa
fatto per player6 e AS1.0
adesso ho la necessità di farlo funzionare per player8 e AS2.0
ho provato ma mi dà degli errori
oltretutto i campi di input non mi fanno più inserire i valori !?
questo il code:
// FAHRENHEIT TO CELSIUS COVERSION
FtoC = function () {
value = new String((Number(fDeg.text)-32.0)*5.0/9.0);//<---ERRORE
// ROUNDING TO ONE CHARACTER AFTER PERIOD
if (value.indexOf(".") != -1) {
rond = value.indexOf(".")+2;
cDeg.text = value.substring(0, rond);
} else {
cDeg.text = value;
}
};
// CELSIUS TO FAHRENHEIT COVERSION
CtoF = function () {
fDeg.text = (Number(cDeg.text)/5.0*9.0)+32;
};
// CONVERT COMMA TO PERIOD
noComma = function (txtfld) {
if (txtfld.text.indexOf(",", 0) != -1) {
nmb = txtfld.text.split(",", 2);
txtfld.text = nmb[0]+"."+nmb[1];
}
};
// EVENTS
cDeg.onChanged = function() {
noComma(this);
CtoF();
meter.update();
};
fDeg.onChanged = function() {
noComma(this);
FtoC();
meter.update();
};
// FIRST CALL:
meter.update();//è la barretta del termometro che si allunga-accorcia
mi potete aiutare :master: