Why does the trace in the loop below return false
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???
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![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;
}
}
]]>
</mx:Script>
<mx:XML id="myXML">
<root xmlns="letters">
<a>true</a>
<b>true</b>
<c>true</c>
<e>true</e>
<f>true</f>
<g>true</g>
</root>
</mx:XML>
<mx:Button click="checkXML();" />
</mx:Application>