Thread: xml and flash
View Single Post
  #1 (permalink)  
Old June 9th, 2007, 10:06 AM
ekosoft ekosoft is offline
Registered User
 
Join Date: Jun 2007
Location: Plantersville, TX, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default xml and flash

ok, i have this part of a code, its pulling the xml and putting it into text boxes.

Code:
      var minorsnodes:Array = newxml.firstChild.firstChild.nextSibling.childNodes;
      for (var i:Number = 0; i < minorsnodes.length; i++) {
         // for each mode node:
         var minornode:XMLNode = minorsnodes[i];
         modes.push(
            {i:i+1,
             pname:minornode.attributes.name,
             desc:minornode.childNodes[0].attributes.name,
             desc1:minornode.childNodes[1].attributes.name,
             desc2:minornode.childNodes[2].attributes.name,
             desc3:minornode.childNodes[3].attributes.name,
             score:minornode.childNodes.childNodes[1].attributes.value
         });
         //2d array
         //xslt html
      }


this is the xml being used

Code:
<?xml version="1.0" encoding="UTF-8"?>
<scorelist version="0">
   <user>Sciandu</user>
   <game name="Harmonic Convergence Deluxe">
     <major_mode name="Race">
       <minor_mode display_mode="time" name="Asteroid">
         <score value="35" login="Sciandu"/>
       </minor_mode>
       <minor_mode display_mode="time" name="Breach">
         <score value="65" login="Sciandu"/>
       </minor_mode>
       <minor_mode display_mode="time" name="Radioactive Rose">
         <score value="24" login="Sciandu"/>
       </minor_mode>
       <minor_mode display_mode="time" name="Art">
         <score value="42" login="Sciandu"/>
         <score value="54" login="Mehh"/>
         <score value="54" login="tmp1"/>
         <score value="91" login="User1"/>
         <score value="99" login="Sciandu"/>
       </minor_mode>
     </major_mode>
     <major_mode name="Challenge">
       <minor_mode display_mode="number" name="-">
         <score value="14" login="Sciandu"/>
       </minor_mode>
     </major_mode>
     <major_mode name="Frenzy">
       <minor_mode display_mode="number" name="Camp Fire">
         <score value="79" login="Sciandu"/>
       </minor_mode>
       <minor_mode display_mode="number" name="Art">
         <score value="54" login="Sciandu"/>
       </minor_mode>
       <minor_mode display_mode="number" name="Ritual">
         <score value="59" login="tmp1"/>
         <score value="53" login="Sciandu"/>
         <score value="2" login="Mehh"/>
       </minor_mode>
     </major_mode>
   </game>
</scorelist>
what i need to do is be able to index the minor modes into one text box instead of each one having their own and index them into one, and i need to be able to index each score for each minor mode accordingly. The problem is it wont let me index if i use childNodes[i] here
Code:
desc1:minornode.childNodes[1].attributes.name,
im guessing its because its already in an index, but i dont know, can anyone help me?