A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Continous Flash Video

  1. #1
    Junior Member
    Join Date
    Nov 2005

    Continous Flash Video


    Can anyone help me?

    I've made the tutorial "7. Progressive Flash Video Player Part 2 - Additional component development" on this link:


    and it was great! Congratulations Tiago Dias!

    But i need something quite diferent. I want that the videos in XML file play continously without the combo box.

    This code works with event change

    var movList:Object = new Object ();
    movList.change = function () {
    ns.play (cbMovie.getItemAt (cbMovie.selectedIndex).data);
    pauseButton._visible = true;
    playButton._visible = false;
    cbMovie.addEventListener ("change", movList);

    I try instead the complete event to go to the next video in the XML, but doesn't works..

    var cmpVideo:Object = new Object ();
    cmpVideo.complete = function () {
    // in here i advance to next video
    myVideo.addEventListener ("complete", cmpVideo);

    myVideo is the name of the instance Video 1 that i created.

    thanks in advance anyone!

  2. #2
    Junior Member
    Join Date
    Dec 2005

    i got it

    At first i tried to use netstream.play(); to show continously movie from XML list without combo box. But it didn't work

    but finally i found the way to do it mu hahahaah by using FLVPlayback and it worked but there r some strange problem.

    1. some .flv file will freeze the program after the movie end so when u test running and it doesn't change to next movie u might change other .flv.

    2. i try to put xmllist.onLoad = function(status) on the top of script but the program always jump to other place after this statemant so i put them in the bottom of the script and it worked.

    and this's the link i found but he didn't use xml import so i modified a bit and cut something and named the FLVPlayback as "myVideo".


    ok now let see my script.

    /********** and this's in my .as or in .fla" ************/

    // Set full screen
    fscommand("fullscreen", true);

    // Set Videos Behavior
    var videos:Object = new Object();

    // Set Initial video list
    videos.list = new Array();
    videos.list[0] = "file:///C|/AUsys/vdo/ad.flv"; // initial screen
    videos.loop = true;
    videos.length = 1;
    videos.loaded = false;

    // Path to FLVPlayback components
    var m = this.myVideo;

    // Set the path of the first video feed
    m.contentPath = videos.list[0];
    m.addASCuePoint(3, "firstCue");

    // Set a 'ready' event handler to load the videos
    videos.ready = function(evt:Object):Void {
    if (!this.loaded) {
    this.loaded = true;
    for (var n = 0; n<this.list.length; n++) {
    if (videos.list[n].indexOf(".flv") != -1) {
    m.activeVideoPlayerIndex = n;
    m.contentPath = videos.list[n];
    m.addASCuePoint(3, "secondCue");
    m.activeVideoPlayerIndex = 0;
    m.addEventListener("ready", videos);

    // 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 {
    m.activeVideoPlayerIndex = nextIndex;
    m.visibleVideoPlayerIndex = nextIndex;
    m.addEventListener("complete", videos);
    // End Set Videos Behavior

    // Set Video Index Behavior
    this.myVideo.activeVideoPlayerIndex = 0;
    this.myVideo.visibleVideoPlayerIndex = 0;
    // End Set Video Index Behavior

    //setup a variable to hold the XML\
    var xmllist = new XML();
    xmllist.ignoreWhite = true;
    //load the XML file
    xmllist.onLoad = function(status) {
    if (!status) {trace(status);}
    var movies:Array = this.firstChild.childNodes;
    for (var i=0;i <movies.length; i++) {
    // move the .flv location to the video list
    videos.list[i] = movies[i].attributes.url+movies[i].attributes.src;
    videos.loop = true;

    // i hope it might be useful for u good luck
    Last edited by superjackz; 12-05-2005 at 07:01 PM. Reason: my xml list disappeared after edit T_T

  3. #3
    Junior Member
    Join Date
    Dec 2005

    i got it

    and this is for XML list "VDOlist.xml"

    movies url="file:///C|/AUsys/vdo/" src="c4[1].flv" moviename="C4_Dance"/>
    movies url="file:///C|/AUsys/vdo/" src="cafe_townsend_chef.flv" moviename="Chef"/>
    movies url="file:///C|/AUsys/vdo/" src="darklord.flv" moviename="Darklord"/>
    movies url="file:///C|/AUsys/vdo/" src="tsunami[1].flv"moviename="Tsunami"/>
    movies url="file:///C|/AUsys/vdo/" src="cafe_townsend_chef.flv" moviename="Chef"/>
    movies url="file:///C|/AUsys/vdo/" src="water.flv" moviename="Water"/>
    movies url="file:///C|/AUsys/vdo/" src="MAMMAAND.flv" moviename="MAMMAAND"/>

    /**** file:///C|/AUsys/vdo/ is my C:\AUSYS\VDO\
    /***** i dont' know why this list will disappear from this reply box if i put "<" in front of them so don't for get to put it by urself :P
    Last edited by superjackz; 12-05-2005 at 07:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center