Dynamic video playlist

I haven’t received a single response on three other forums. Perhaps SitePoint users can help me?

The following application uses FLVPlayback for playing videos. There is a cool tileList feature on the righthand side that has an image for each video. The user can click on an image to play the respective video. All of the video data, thumbnail data, and text data is contained in a xml file called playlist.xml.

I need help coding the application to automatically play the next video in the tileList without the user having to click on the thumbnail to play it.

Essentially, when a video is finished playing, how can it play the next video in playlist.xml without the user manually selecting it and clicking play?

package {
	import flash.display.MovieClip;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.events.Event;
	import fl.controls.listClasses.CellRenderer;
	import fl.controls.ScrollBarDirection;
	import flash.text.TextFormat;
	import fl.controls.TextArea;
	import fl.controls.TileList;


	public class VideoPlaylist extends MovieClip {
		private var xmlLoader:URLLoader;
		private var textStyle:TextFormat;
		private var description:TextArea;
		public var str:String;
		public function VideoPlaylist():void {
			// Load the playlist file, then initialize the media player.
			xmlLoader = new URLLoader();
			xmlLoader.addEventListener(Event.COMPLETE, initMediaPlayer);
			xmlLoader.load(new URLRequest("playlist.xml"));
			
			// Format the tileList, specify its cellRenderer class.
			tileList.setSize(200, 240);
			tileList.columnWidth=180;
			tileList.rowHeight=60;
			tileList.direction=ScrollBarDirection.VERTICAL;
			tileList.setStyle("cellRenderer", Thumb);
			textStyle = new TextFormat();
			textStyle.font="Tahoma";
			textStyle.color=0xFF0000;
			textStyle.size=11;
			tileList.setRendererStyle("textFormat", textStyle);
			///////////////


		}

		public function initMediaPlayer(event:Event):void {
			var myXML:XML=new XML(xmlLoader.data);
			var item:XML;
						
			for each (item in myXML.vid) {// populate playlist.
				// Get thumbnail value and assign to cellrenderer.
				var thumb:String;
				if (item.hasOwnProperty("@thumb")>0) {
					thumb=item.@thumb;
				}// Send data to tileList.
				tileList.addItem({label:item.attribute("desc").toXMLString(),str:item.attribute("contenu").toXMLString(), 
				data:item.attribute("src").toXMLString(),
				source:thumb});

			}
			// Select the first video.
			tileList.selectedIndex=0;
			// Listen for item selection.
			
			tileList.addEventListener(Event.CHANGE, listListener);
			
			// And automatically load it into myVid.
			myVid.source=tileList.selectedItem.data;
			// Pause video until selected or played.
			//myVid.pause();
			
			myVid.play();
			
			//tileList.addEventListener(Event.CHANGE , playNext);
		
			//currentFPS and if it is 0, the movie has ended (or it was paused, so you'll have to check for that too).  
			
		}

		// Detect when new video is selected, and play it
		function listListener(event:Event):void {
			myVid.play(event.target.selectedItem.data);
			////////////////////////////////////////////
			var description:TextArea = new TextArea();
			description.setSize(202,46);
			description.move(365, 315);
			//description.text=tileList.selectedItem.str;
			description.text=tileList.selectedItem.data;
			addChild(description);
			
		}
		/*function playNext(event:Event):void {
			
			for (var i =0; i<tileList.length; i++){
				myVid.play(event.target.selectedItem.data);
				tileList.selectedIndex=i; //this is highlighting the second video in the tileList. Nothing to do with playing a vid
			}
			
		}*/


	}
}
package {
	import fl.controls.listClasses.ICellRenderer;
	import fl.controls.listClasses.ImageCell;
	import fl.controls.TileList;
	import flash.text.*;
	
	public class Thumb extends ImageCell implements ICellRenderer {  
		private var desc:TextField;
		private var textStyle:TextFormat;
		
		// **** Additional text description field ****
		private var about:TextField;
		private var textStyle2:TextFormat;
		// ****
		
    	public function Thumb() {
			super();
			
			loader.scaleContent = false;
			useHandCursor = true;
			
			// set skins
			setStyle("upSkin", ThumbCellBg);
			setStyle("downSkin", ThumbCellBg);
     	    setStyle("overSkin", ThumbCellBgOver);
			
     	    setStyle("selectedUpSkin", ThumbCellBgSelected);
    		setStyle("selectedDownSkin", ThumbCellBgSelected);
    	    setStyle("selectedOverSkin", ThumbCellBgSelected);
			
			// Create and format desc
			desc = new TextField();
			desc.autoSize = TextFieldAutoSize.LEFT;
			desc.x = 75;
			desc.width = 110;
			desc.multiline = true;
			desc.wordWrap = true;
			addChild(desc);
			
			// **** Additional text description field ****
			about = new TextField();
			about.autoSize = TextFieldAutoSize.LEFT;
			about.x = 75;
			about.y = 28;
			about.width = 110;
			about.multiline = true;
			about.wordWrap = true;
			addChild(about);
			// ****
			
			textStyle = new TextFormat();
			textStyle.font = "Tahoma";
			//textStyle.color = 0xCC0000;
			textStyle.size = 11;
			
			
			// **** Additional text description field ****
			textStyle2 = new TextFormat();
			textStyle2.font = "Tahoma";
			//textStyle2.color = 0xFF0000;
			textStyle2.size = 9;
			// ****
    	}
	
		override protected function drawLayout():void {
			// Position cell elements; tweak these for your thumbs if needed
			var imagePadding:Number = getStyleValue("imagePadding") as Number;
			loader.move(11, 5);
			
			var w:Number = width-(imagePadding*2);
			var h:Number = height-imagePadding*2;
			
			if (loader.width != w && loader.height != h) {
				loader.setSize(w,h);
			}
			
			loader.drawNow();

			desc.text = data.label;
			desc.setTextFormat(textStyle);
			
			// **** Additional text description field ****
			about.x = desc.x;
			about.y = desc.y + desc.height;
			about.text = data.str;
			about.setTextFormat(textStyle2);
			// ****
			
			background.width = width+5;
			background.height = height+1;
			textField.visible = false;
		}
	}
}