A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: selecting from list box components!

  1. #1
    Member
    Join Date
    May 2011
    Posts
    39

    selecting from list box components!

    Hiya,

    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}); 
    
            } 
    
        }

  2. #2
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    760
    Maybe it's just me but not clear what you're asking for here.
    [SIGPIC][/SIGPIC]

  3. #3
    Member
    Join Date
    May 2011
    Posts
    39
    no wories i figured it out . basically what i wanted was some code that populated a list component from an XML, showing reportnames all in a list..
    Then when any of the reports are selected, its description only will be shown in a seperate text field component.!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center