1 Reply Latest reply on Jun 27, 2011 5:35 AM by Anirudh Sasikumar

    Arrays to List component

    blackmarketbear Level 1

      I am fairly new AS3 coder now using Flash Builder and I can't work out how to display my data (a collection of actionscript arrays returned by a AS3 function) in a List component as a list of labels and images. My arrays look like this:


      var aNames:Array = new Array("John", "Ringo", "Paul");

      var aImages:Array = new Array("http://myserver.com/image1.jpg", "http://myserver.com/image2.jpg", "http://myserver.com/image3.jpg");


      Now I want to display them in a list component, each list item has the image on the left and then the name on the right.


      Can anyone provide an example please, I think I need to use an arraycollection and a custom item renderer inside the list and then have the lists dataprovider set to the arraycollection but have not been able to construct the code.


      Many thanks.