View Full Version : Using icons with list component

12-10-2008, 10:37 PM
I have a custom flash video player with a list of videos (using the list
component). The video descriptions and locations of the .flv files are extracted and generated from an XML file.
(See http://www.cloudcaptech.com/moviepla...ery_video.shtm)

I have thumbnail images next to each list item.
These thumbnails, (or icons) are symbols imported from the library.

Is there a way to use info from the XML file to specify the URL of the icon
thumbnails, then load them into a placeholder symbol instead of having
to place them in the library to use as icons next to each list component?

I've tried to put a placeholder symbol in the library, then use loadMovie into this placeholder to load each thumbnail image for the icons but I can't seem to get that to work. Here's the code:

var videos2:Array = this.firstChild.childNodes; //take all video tags in xml file and put into an array which will populate list component
videoList_piccolo.iconField="icon"; //designate the icon field
for (index=0;index<videos2.length;index++) { //iterate through array of videos and populate the list
var labelItem:String = videos2[index].attributes.desc; //the video description
var dataItem:String = videos2[index].attributes.url; //the video url
var imageItem:String = videos2[index].attributes.img; //the thumbnail url

icon_placeholder.loadMovie( imageItem ); //load image into placeholder symbol
videoList_piccolo.addItem({label:labelItem, data:dataItem, icon:icon_placeholder, img:imageItem}); //add items to the list