Código ActionScript :
function calculate() { var _num1 = num1_txt.text != "" ? (Number(num1_txt.text)) : (0); var _num2 = num2_txt.text != "" ? (Number(num2_txt.text)) : (0); var _total = total_txt.text != "" ? (Number(total_txt.text)) : (0); var _myMessage = message_txt.text != "" ? (Number(message_txt.text)) : (0); total_txt.text = _num1 + _num2 != 0 ? (String(_num1 + _num2)) : (""); //if---> /*if (_total<10.5) { message_txt.text="low"; } else if (_total<=10.5) { message_txt.text="normal"; } else if (_total>=20.5) { message_txt.text="high"; } else if (_total>=30.5) { message_txt.text="extra!"; } else message_txt.text="start";*/ //switch---> switch(_total) { case _total<10.5: message_txt.text="low"; break; case _total<=10.5: message_txt.text="normal"; break; case _total>=20.5: message_txt.text="high"; break; case _total>=30.5: message_txt.text="extra!"; break; default: message_txt.text="start"; break; } } num1_txt.onChanged = function () { calculate(); }; num2_txt.onChanged = function () { calculate(); }
Agradecería mucho un poco de ayuda