Hi folks,
Realllly quick question. How do I go about retreiving the attribute value in the following XML script. In this case “atl” in the first child?
<?xml version="1.0" encoding="iso-8859-1"?>
<hotels>
<prop id="atl">
<name>Atlantic City</name>
<lowest_rate>129</lowest_rate>
</prop>
<prop id="blv">
<name>Georgetown</name>
<lowest_rate>149</lowest_rate>
</prop>
<prop id="cac">
<name>Miami</name>
<lowest_rate>169</lowest_rate>
</prop>
<prop id="las">
<name>Las Vegas</name>
<lowest_rate>169</lowest_rate>
</prop>
</hotels>
And here’s my AS:
var xmlMe:XML = new XML();
xmlMe.ignoreWhite = true;
xmlMe.load("lowest_rate.xml");
xmlMe.onLoad = function(p_success:Boolean){
trace("::CODE IS SUCCESSFUL::");
//Below is a sample XML path, you will need to confirm
//the correct path for your needs.
trace(this.firstChild.attributes.path);
};
Obviously, my trace isn’t bringing up the right value…
Any help would be greatly appreciated!