flash and video ?
- Started
- Last post
- 7 Responses
- Gooners
anyone know how, with actionscript, to let a movie clip know to load after a video is done playing?
Does this make sens?
- amullins0
like, listening to the netstream for stop?
- falcadia0
////////////////////////////////...
//////////VIDEO CONTROL//////////////////////
////////////////////////////////...import mx.video.*;
var myVid:FLVPlayback = levMain.attachMovie("FLVPlayback... "myVid", 0);
myVid.autoPlay = true;
myVid.bufferTime = 1;
myVid.autoSize =false;
myVid.maintainAspectRatio =true;
//myVid.contentPath ='../videos/clip1.flv';//////
// Set Videos Behavior// Create a videos object to hold a video
// playlist and event handler functions...
var videos:Object = new Object();// Set up to 7 video feeds in a single component
videos.list = new Array();
videos.list[0] = "../videos/clip1.flv";
videos.list[1] = "../videos/clip2.flv";
videos.list[2] = "../videos/clip3.flv";
videos.list[3] = "../videos/clip4.flv";
videos.list[4] = "";
videos.list[5] = "";
videos.list[6] = "";
videos.loop = true;
videos.length = 1;
videos.loaded = false;// Path to FLVPlayback components
var m = myVid;// Set the path of the first video feed
m.contentPath = videos.list[0];// Set a 'ready' event handler to load the videos
videos.ready = function( evt:Object ):Void
{
if(!this.loaded){
this.loaded = true;
for( var n=1; n<this.list.length; n++ ){
if( videos.list[n].indexOf(".flv") != -1 ){
m.activeVideoPlayerIndex = n;
m.contentPath = videos.list[n];
this.length++;
}
}
m.activeVideoPlayerIndex = 0;
}
}
m.addEventListener("ready",video...// Set a 'complete' event handler to load the next video
videos.complete = function( evt:Object ):Void
{
var nextIndex = Number(evt.vp)+1;
if( nextIndex == this.length){
if( this.loop ){
nextIndex = 0;
}else{
return;
}
}
m.activeVideoPlayerIndex = nextIndex;
m.visibleVideoPlayerIndex = nextIndex;
m.play();
}
m.addEventListener("complete",vi...// End Set Videos Behavior
///////////////////
- falcadia0
Sorry that came out longer than I thought. This will create an arry of vids and plays them in order after each other.
- Gooners0
yes i think like, listening to the netstream for stop? I am kind of a newbie, how would you do that
- falcadia0
You'll need to change this:
var myVid:FLVPlayback = levMain.attachMovie("FLVPlayback... "myVid", 0);the "levMain" to _root or whatever your target timeline is.
and it looks like this got cut off at very bottom.
m.addEventListener("complete",vi...
- falcadia0
arrg.. ,videos);
- amullins0
Just in case you're using AS3:
NetStream.addEventListener(NetSt... function(e:NetStatusEvent):void {
if (e.info.code=="NetStream.Play.St... {
var _loader:Loader = new Loader();
_loader.addEventListener(Event.I... function(e:Event):void {
trace("mc loaded");
});
_loader.load(new URLRequest("mc's url"));
}
});