title: How can I check for the existence of an XML node in Flex/AS3?
body: <p>Why does the trace in the loop below return <code>false</code> for every iteration, even though there ARE nodes named with 6 of the 8 possible values??? This only happens when I have a namespace. Is there some other way to check for the node values???</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt;
      &lt;mx:Script&gt;
          &lt;![CDATA[
              private namespace ltrs = "letters";
  
              use namespace ltrs;
  
              private var myArray:Array = ["a","b","c","d","e","f","g","h"];
  
              private function checkXML():void
              {
                  for each (var p:String in myArray)
                  {
                      trace(myXML.hasOwnProperty(p).toString()); // returns false;
                  }
              }
          ]]&gt;
      &lt;/mx:Script&gt;
  
      &lt;mx:XML id="myXML"&gt;
          &lt;root xmlns="letters"&gt;
              &lt;a&gt;true&lt;/a&gt;
              &lt;b&gt;true&lt;/b&gt;
              &lt;c&gt;true&lt;/c&gt;
              &lt;e&gt;true&lt;/e&gt;
              &lt;f&gt;true&lt;/f&gt;
              &lt;g&gt;true&lt;/g&gt;
          &lt;/root&gt;
      &lt;/mx:XML&gt;
  
      &lt;mx:Button click="checkXML();" /&gt;
  &lt;/mx:Application&gt;
  </code></pre>