FORUMS: list search recent posts

Sequencing video clips with actionscript

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
charles michael fulton
Sequencing video clips with actionscript
on Jan 25, 2008 at 6:10:03 pm

Hello all,

I posted earlier about "editing" video with Flash. I think that term might have turned a lot of people off . . . but, after some research, I've figured out that all I need to do is to load two videos and then write some actionscript so that the first video plays, and then when that one is complete, the second video plays.

I've got a Flash/Actionscript book on the way, but does anyone know if there is a command that will do this? Will I/can I write my own code for this kind of operation?

Thanks!

CMF


Return to posts index

DaveTrep
Re: Sequencing video clips with actionscript
on Jan 28, 2008 at 4:59:32 pm

Hi CMF

First of all you need to create an array of filepaths to your videos and associate the first video in the array to the first video in the list. Place all of the following code in the script for the frame where your player is.

var vidArray:Array = new Array(vid1.flv, vid2.flv);
var vidIndex = 0;
flvPlayer.contentPath = vidArray[0];

Then create a listener that you attach to the player.

var playerListener:Object = new Object();
playerListener.complete= function(eventObj){
flvPlayer.contentPath = vidArray[vidIndex++];
flvPlayer.play();
}
flvPlayer.addEventListener("complete", myListener);

I have only just found the .complete method so have not tried it. In the past I have done the following:

var playerListener:Object = new Object();
playerListener.change= function(eventObj){
if (flvPlayer.playheadTime > flvPlayer.totalTime-0.2){
flvPlayer.contentPath = vidArray[vidIndex++];
flvPlayer.play();
}
}
flvPlayer.addEventListener("change", myListener);

One of those should work

Cheers

Dave.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]