Hi, I was wondering if anyone could look over this and advise me on why the output would be NaN?
stop();
convertToCNY_btn.onRelease = convertToCNY;
convertToUSD_btn.onRelease = convertToUSD;
function convertToCNY() {
trace("convertToCNY clicked");
var USDtoCNYexchangeRate = Number(7.16);
var USDinput = Number(USDinput_tf.text);
trace(USDinput);
var CNYrate = ( USDinput / USDtoCNYexchangeRate );
trace(CNYrate);
trace(USDtoCNYexchangeRate);
USDconverted_tf.text = CNYrate;
}
I actually have to use xml to get the exchange rate, but I’d figure I’d start off like this to see if it works. Obviously it doesn’t, for reasons beyond me, as it always is XD;