8 Replies Latest reply on Jul 20, 2007 7:06 AM by Handycam

    How to get XML node to be a number

    Handycam Level 1
      In my XML file, I have an item like:

      <myxml>
      <amount>5</amount>
      </myxml>

      In my Flex code, I have a variable:

      public var stockOnHand:Number;

      and

      private function dataHandler(event:ResultEvent):void {
      stockOnHand = event.result.myxml.amountt;
      }

      but if I try to access that variable I find it's value to be "NaN". So it's not registering as a number, must be a string. Why?