LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-01-2006, 10:10 AM
aussie01 aussie01 is offline
Registered User
 
Join Date: Mar 2005
Posts: 12
Rep Power: 0
aussie01 is on a distinguished road
FLV chosen to play from XML - Flash 8 Pro.

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!
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Glitch in my first Flash project keress Newbies 8 12-28-2006 02:49 PM
Find and replace in XML string as it loads into Flash mm-92 Flash Video 3 08-03-2006 08:02 PM
Open Letter to Macromedia molaram General Flash 10 02-18-2005 01:29 AM
Wildform Releases Flix Pro 4 Colby Devitt New Softwares 0 05-20-2004 07:43 PM
how to transfer the components from flash MX to flash MX 2004 Pro?? firefly Flash MX 2004 3 10-09-2003 11:13 PM




All times are GMT. The time now is 12:36 AM.