What i have is a list box populated from an XML file, in this XML file it will contain name and description
What i would like is when a name is clicked/hovered over from the list menu… in a seperate text box component the description for that report will appear!!
Code:
Here is the XML :
<?xml version="1.0"?>
<_reportlist>
<reportdetails name="Product Installations and Removals">
<desc>The report focuses provides visability of installations and removals down to account level. these reports include any product additions and removals on accounts based upon the install date and removal date of the product.</desc>
</reportdetails>
<reportdetails name="Product price variation report">
<desc>The report provides visability of discounts or promotions applied to accounts at product level</desc>
</reportdetails>
</_reportlist>
here is my as3 code:
Code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("reports.xml"));
function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
ParseReports(xmlData);
}
function ParseReports(ReportXML:XML):void {
var ReportList:XMLList=ReportXML.reportdetails.@name;
rList.removeAll();
for each (var reportsTitle:XML in ReportList) {
rList.addItem({label:reportsTitle});
}
}