Listing 1: fmsvideo.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application pageTitle="My FMS Video Player" xmlns:mx="http://www.adobe.com/2006/mxml" initialize=" HYPERLINK  \l
 "initAppfx" initApp()1" creationComplete=" HYPERLINK  \l "PageLoadedfx" PageLoaded()2" layout="vertical">
 	<!-this http service is used to supply the dataProvider for the ComboBox list of videos
<mx:HTTPService id="videoService" url="theVideos.xml" showBusyCursor="true" />

<mx:Script>
	<![CDATA[
	import mx.events.VideoEvent;
	import mx.controls.Alert;

	[Bindable] private var dp:Array;
	[Bindable] private var bgimage:String = "";
	private var blnLoadDelayRunOnce:Boolean = false;

	private function initApp()1:void {
	vidDisplay.autoBandWidthDetection = false;
            	vidDisplay.source = "rtmp://your_domain/videos/defleppard_photograph.flv";
		videoService.send();
	}

	private function PageLoaded()2:void {
		var myTimer:Timer = new Timer(1000, 0);
		myTimer.addEventListener("timer", onTimer);
		myTimer.start();
	}

	private function onTimer(event:TimerEvent):void {
		if (!blnLoadDelayRunOnce) {
			readytoContinue();
		}
	}

	private function readytoContinue()3:void {
		if (videoService.lastResult.videos.video!=undefined) {
			//mx.controls.Alert.show("number of videos: " + videoService.lastResult.videos.video.length);
			var aryTemp:Array = new Array();
			for (var i:Number=0; i<videoService.lastResult.videos.video.length; i++) {
	aryTemp.push({name: videoService.lastResult.videos.video[i].name, label:
	 videoService.lastResult.videos.video[i].label});
	}
	dp = aryTemp;
	cbxVideo.dataProvider = dp;
	}
	blnLoadDelayRunOnce = true;
}

private function playVideo(stream:String)4:void {
	if (stream!=null) {
	//Alert.show(stream);
	vidDisplay.autoBandWidthDetection = false;
	vidDisplay.source = "rtmp:// your_domain /videos/" + stream + ".flv";
	vidDisplay.addEventListener(Event.COMPLETE, onComplete)5;
	vidDisplay.play();
		btnPlay.enabled = false;
		btnMute.enabled = true;
		btnPause.enabled = true;
		btnStop.enabled = true;
	            	swfLoad.source = "delirio.swf";
	}
}

	private function onComplete(event:Event):void {
	swfLoad.source = null;
		btnPlay.enabled = true;
		btnMute.enabled = false;
		btnPause.enabled = false;
		btnStop.enabled = false;
	}

	private function pauseVideo(stream:String):void {
		if (stream!=null) {
			vidDisplay.pause();
			btnPlay.enabled = true;
	            	swfLoad.source = null;
		}
	}


	private function stopVideo(stream:String):void {
		if (stream!=null) {
			vidDisplay.stop();
			vidDisplay.close();
			btnStop.enabled = false;
			btnPause.enabled = false;
			btnMute.enabled = false;
			btnPlay.enabled = true;
	            	swfLoad.source = null;
		}
	}

	private function muteVideo(stream:String):void {
		if (stream!=null && btnMute.label=="Mute") {
			vidDisplay.volume = 0;
			btnMute.label = "Sound On";
	            	swfLoad.source = null;
		} else if (stream!=null && btnMute.label=="Sound On") {
			vidDisplay.volume = 1;
			btnMute.label = "Mute";
	            	swfLoad.source = "delirio.swf";
		}
	}

	private function viewSource():void {
	var u:URLRequest = new URLRequest("srcview/index.html");
		navigateToURL(u,"_blank");
	}
	]]>
</mx:Script>

<mx:Panel title="Rock it to me" color="#E21C51" height="{vidDisplay.height + 80}" width="{vidDisplay.width + 40}"
 horizontalAlign="center" verticalAlign="middle">
<mx:VideoDisplay id="vidDisplay" source="{null}" autoPlay="false" maintainAspectRatio="true"/>
	<mx:HBox>
	        <mx:Button id="btnPlay" label="Play" click="playVideo(cbxVideo.selectedItem.name)" enabled="false"/>
	        <mx:Button id="btnPause" label="Pause" click="pauseVideo(cbxVideo.selectedItem.name)" enabled="false"/>
	        <mx:Button id="btnStop" label="Stop" click="stopVideo(cbxVideo.selectedItem.name)" enabled="false"/>
	        <mx:Button id="btnMute" label="Mute" click="muteVideo(cbxVideo.selectedItem.name)" enabled="false"/>
	</mx:HBox>
</mx:Panel>
<mx:ComboBox id="cbxVideo" dataProvider="{dp}" labelField="label" change=" HYPERLINK  \l "playVideo"
 playVideo(cbxVideo.selectedItem.name)4" toolTip="Select the video you want to play..."/>
<mx:Spacer height="10"/>
<mx:SWFLoader id="swfLoad" source="{null}" width="50" height="50" click="viewSource()" toolTip="Click to view the
 source..."/>

</mx:Application>

Listing 2: theVideos.xml

<?xml version="1.0" encoding="iso-8859-1"?>
<videos>
	<video>
		<label>Select a video...</label>
		<name>null</name>
	</video>
	<video>
		<label>Def Leppard - Hysteria</label>
		<name>defleppard_hysteria</name>
	</video>
	<video>
		<label>Def Leppard - Love Bites</label>
		<name>defleppard_love_bites</name>
	</video>
</videos>