1 Reply Latest reply on Feb 7, 2008 5:11 AM by Gregory Lafrance

    casting issues

      Why does:

      var objVar:Object = xmlItem.@firstNum - xmlItem.@secondNum;

      give me a Number (1.5);
      but the next line:

      objVar = objVar + xmlItem.@firstNum;

      give me 1.5887.70 - i.e. it cocatenates the two numbers as strings.
      If I cast the result explicitly as a Number:

      objVar = Number(objVar + xmlItem.@firstNum);

      I get NaN?

      I dont care if the result is stored as a String or a Number in the Object variable, but I want the sum to execute...