CalumK
09-03-2009, 01:48 AM
Hello all, I am trying to make a video playlist for FLVplayback in flash, but im getting stuck...
basically i want to have the first video play (without clicking anything) then as soon as it finishes, i want the second video to start, once that has finished, the third video ect: once i get to the last video i want it to loop back to the first.
so far i have this code (wrote myself)
/**
FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
var first = "yes"
if (first == "yes") {
my_FLVPlybk.contentPath = "http://calumk.com/mini.flv";
var first = "no";
var lastplayed = "mini";
}
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
if (lastplayed == "mini") {
my_FLVPlybk.contentPath = "http://ck/danjames/cloning.flv";
var lastplayed = "clone";
var listenerObject:Object = new Object();
my_FLVPlybk.addEventListener("complete", listenerObject);
}
else if (lastplayed == "clone") {
my_FLVPlybk.contentPath = "http://ck/danjames/whitenerd.mp4";
var lastplayed = "whitenerd";
var listenerObject:Object = new Object();
my_FLVPlybk.addEventListener("complete", listenerObject);
}
}
my_FLVPlybk.addEventListener("complete", listenerObject);
when this is run the first video plays, followed by the second.. but then it stops after the second.....
Hopefully you can see what i have tried to do....
I play a video, mark it as being the last played, and therefor assign the next to play...,
any advice (even a complete rewrite) would be helpfull..
Thankyou
Calumk
p.s just to let you know some of the videos in this are hosted locally the "http://ck" redirects to my localhost , not ck.com
basically i want to have the first video play (without clicking anything) then as soon as it finishes, i want the second video to start, once that has finished, the third video ect: once i get to the last video i want it to loop back to the first.
so far i have this code (wrote myself)
/**
FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
var first = "yes"
if (first == "yes") {
my_FLVPlybk.contentPath = "http://calumk.com/mini.flv";
var first = "no";
var lastplayed = "mini";
}
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
if (lastplayed == "mini") {
my_FLVPlybk.contentPath = "http://ck/danjames/cloning.flv";
var lastplayed = "clone";
var listenerObject:Object = new Object();
my_FLVPlybk.addEventListener("complete", listenerObject);
}
else if (lastplayed == "clone") {
my_FLVPlybk.contentPath = "http://ck/danjames/whitenerd.mp4";
var lastplayed = "whitenerd";
var listenerObject:Object = new Object();
my_FLVPlybk.addEventListener("complete", listenerObject);
}
}
my_FLVPlybk.addEventListener("complete", listenerObject);
when this is run the first video plays, followed by the second.. but then it stops after the second.....
Hopefully you can see what i have tried to do....
I play a video, mark it as being the last played, and therefor assign the next to play...,
any advice (even a complete rewrite) would be helpfull..
Thankyou
Calumk
p.s just to let you know some of the videos in this are hosted locally the "http://ck" redirects to my localhost , not ck.com