I'm considering creating a file that will contain an flv video player that will play 1 of 3 clips depending on what is stated in an XML file.

The long and the short of it is I want to create a page that displays live sports results. The page (which is team specific) will display the score throughout the match.

The layout of the page will be simple, with the score in the centre (which updates through an XML file) and an flv video being shown in a player in the background.

When the score changes during the game, I'll change the XML file and the score will change on the page. Easy.

What I want to happen is for the background video to change too, depending on the current result. So if the team are losing, the background video will be a dreary and dark video, when they are winning a bright happy and sunny video.

Is there a way to have the video player play a video depending on what is in an XML file? Would I need 2 XML files, one for the score and one for the video background?

I have stumbled across the following code which plays a video file which is stated in an XML file.

Code:
var rtmpRoot, instance, file, type;
var x:XML = new XML();
x.ignoreWhite = true;
x.onLoad = function(success) {
	if (!success) {
		trace("Cannot load XML");
	} else {
		trace("Loaded");
		//trace(this);
		
		file = this.childNodes[0].childNodes[0].childNodes[0].toString();
		trace(file.substr(file.length - 3, 3));
		type = file.toLowerCase().substr(file.length - 3, 3);
		trace (type);

	}
};
x.load("movie.xml");
Is there any way to change this code, or create new code, that will go along the lines of...

"If the score in the XML file says 10 - 2, play "winning.flv";
If the score in the XML file is tied at 5 - 5, play "draw.flv";
If the score in the XML file says 2 - 10, play "losing.flv";"

Thanks for any help. I look forward to hearing your ideas!