title: Actionscript 2 reading XML
body: <p>I created an XML file named "stage1.txt" in the folder "musics".
  The XML File is :</p>
  
  <pre><code>&lt;music&gt;
      &lt;speed&gt;10&lt;/speed&gt;
      &lt;time&gt;
          &lt;note&gt;1&lt;/note&gt;
          &lt;note&gt;12&lt;/note&gt;
          &lt;note&gt;32&lt;/note&gt;
          &lt;note&gt;41&lt;/note&gt;
      &lt;/time&gt;
      &lt;where&gt;
          &lt;lane&gt;3&lt;/lane&gt;
          &lt;lane&gt;2&lt;/lane&gt;
          &lt;lane&gt;1&lt;/lane&gt;
          &lt;lane&gt;4&lt;/lane&gt;
      &lt;/where&gt;
  &lt;/music&gt;
  </code></pre>
  
  <p>And then in the flash file I used the following code to recall the XML file :</p>
  
  <p>and then in the flash file I used the following code to get the data.</p>
  
  <pre><code>var myXML:XML = new XML();
  myXML.ignoreWhite=true;
  myXML.load("musics/stage"+_global.stages+".xml");
  var temp = 0, temp2 = 0;
  myXML.onLoad = function(success){
  if (success){
  trace (myXML);
  }
  }
  </code></pre>
  
  <p>It worked fine until here. However, I wanted to recall the first value of the XML file, the "speed".
  I tried using this code :</p>
  
  <pre><code>var speed = myXML.firstChild.firstChild.nodeValue;
  </code></pre>
  
  <p>but it doesn't seem to work.
  Tried other things like :</p>
  
  <pre><code>myXML.firstChild.childNodes[0].nodeValue
  </code></pre>
  
  <p>but doesn't work too.</p>