Hello All,
I am trying to get a video player to play a continuous list of videos, the video list will loaded via XML.
Their is no option to choose what video i just want the video to keep going through the list and when it reaches the end to start at the first video and go through the list.
My Code:
//----------Creating The Video Source To Run----------//
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream (nc);
theVideo.attachVideo(ns);
var videoXML:XML = new XML();
videoXML.ignoreWhite = true;
var videos:Array = new Array();
var videoArray:Array = new Array();
var urls:Array = new Array();
var currentIndex:Number = 0;
videoXML.onLoad = function(success){
if(success){
trace("HELLO");
videos = videoXML.firstChild.childNodes;
for (i=0;i<videos.length;i++){
urls.push(videos*.attributes.url)
}
ns.play(urls[currentIndex],true);
}
else
{
trace("IT WENT WRONG");
}
}
videoXML.load("bannervideo.xml");
My XML:
<?xml version="1.0" encoding="utf-8"?>
<banner>
<video url="GVideos/banner1.flv" />
<video url="GVideos/banner2.flv" />
<video url="GVideos/banner3.flv" />
<video url="GVideos/banner4.flv" />
<video url="GVideos/banner5.flv" />
<video url="GVideos/banner6.flv" />
<video url="GVideos/banner7.flv" />
</banner>
I appear to have a problem but i cannot see what i am doing wrong :ponder: i know it has something to do with this line of code **“ns.play(urls[currentIndex],true);”
**Can anybody tell me what i have done wrong?
Many Many Thanks
Dunkyb123