1 Reply Latest reply on Apr 23, 2008 11:09 AM by FlashTastic

    Get Numbers with xml and flash

      I have this problem getting the numbers from a xml to flash because I only getting two-digit and hay need to get like 8 or more digit numbers and I dont know what happen.

      Here is the AS 2 code:

      var mybook:Number = 0;
      var mymagazine:Number = 0;
      var mycolor:Color = new Color(mccolor);
      function loadXML(loaded) {
      if (loaded) {
      _root.tienda = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
      _root.books = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
      _root.magazine = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;





      book_txt.text = _root.books;
      magazine_txt.text = _root.magazine;

      } else {
      content = "file not loaded!";
      xmlData = new XML();
      xmlData.ignoreWhite = true;
      xmlData.onLoad = loadXML;

      And here is the XML code:

      <?xml version="1.0"?>


      You can see that magazine have more than books but the var mymagazine is getting only the first 2 digit (33). How can hay get all the numbers in my var?

      Here you can see the example of the file http://csform.com/xmltest/

      thanks you!
        • 1. Re: Get Numbers with xml and flash
          FlashTastic Level 1
          I can see all of the digits (58 and 334) on the test file that you posted. It's possible that when you were testing, the font was too large in your dynamic textbox, so only 2 numbers were displaying rather than 3. I tested the code and XML, and all of the values populate into the variables properly.