I have video player that uses elements of the FLVPlayback component and some custom classes...one of which is a configuration manager (that I friend gave me) which makes it easier to load XML without having to go through the whole childNode.childNode complications.
Anyway....everything it XML driven...the video, subtitles (which are generated via cuepoints), video titles and the video list (which are essentially buttons for each video). Right now, what happens is the application runs, all the video titles are listed, and the first video on the list plays....when it ends, the playback stops, loads a screen similar to YouTube where you can choose to replay the recent video or play the next title which is named along with a description. These last two items are also XML driven but what happens is they show the info for the LAST video in the series rather than the next video. And it doesn't matter which video you select..choose the 4th video, it will always show the next video to be the last...choose the last...it will show the same.
I have a function called init that creates the containers, populates the video titles and tell those titles to play in the player when clicked.
Code:
function init ():Void
{
var x = 0;
var y = 0;
var offset = 0;
var initialX = 4;
var initialY = 4;
var offsetX = 2;
var offsetY = 47;
var currentX = initialX;
///this loop connects left nav buttons to corisponding videos
for (i = 0; i < pods.length; i++)
{
if (i != 0 && i % 1 == 0)
{
initialY += offsetY;
currentX = initialX;
}
var container = this.createEmptyMovieClip ("container" + i, this.getNextHighestDepth ());
containerArray.push(container);
container.attachMovie ("playListItem","newListItem",container.getNextHighestDepth (),{_x:currentX, _y:initialY});
container.id=i;
container.cuePointXML = myConfig.xml.videos.video[i].cuePointXML;
container.newListItem.body = myConfig.xml.videos.video[i].desc;
cover.vidNext.vSum = myConfig.xml.videos.video[i].vSum;
cover.vidNext.vidTitle = myConfig.xml.videos.video[i].desc;
if (i == currentVid)
{
container.newListItem.gotoAndStop("_sel");
trace(cover.vidNext.vSum);
}
//container interactivity
container.onRelease = function ()
{
for (var i=0; i<containerArray.length; i++){
containerArray[i].newListItem.gotoAndStop("_deSel");
}
cover._visible=false; // replay-next video screen
this.newListItem.gotoAndStop("_sel");
//trace(_root["container" + selBtn]);
selBtn = this.id;
currentVid=selBtn;
//my_FLVPlybk.stop();
my_FLVPlybk.contentPath = null;
cuePointLoader.load(this.cuePointXML);
};
}
trace("Loading cuePointXML for first video");
cuePointLoader.load(myConfig.xml.videos.video[currentVid].cuePointXML);
}
pulling this code out causes keeps text from populating:
Code:
cover.vidNext.vSum = myConfig.xml.videos.video[i].vSum;
cover.vidNext.vidTitle = myConfig.xml.videos.video[i].desc;
..so I've tried placing it in other locations but not getting favorable results.
Anyway, any suggestions would be helpful. I'll post all the code in a response.