dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to play video 1,2,3 in sequence

  1. #1
    Senior Member
    Join Date
    May 2004
    Posts
    627

    How to play video 1,2,3 in sequence

    I have 3 flv and wanna to play them in sequence.

    This is the script I wrote for one flv
    var my_nc:NetConnection =new NetConnection();
    my_nc.connect(null);
    var my_ns=new NetStream(my_nc);
    my_video.attachNetStream(my_ns);
    my_ns.play("v1.flv");

    How to write in order to play them sequence rather than edit them in AfterEffect?

  2. #2
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    you could use these variables:
    PHP Code:
    var videos:Array = ["v1.flv","v2.flv","v3.flv"];
    var 
    vidID:uint 0
    to store their location and which one to play (Arrays start at 0).

    So using videos[vidID] will return the url to the first video.
    When the video ends, you can react to that (using EventListeners) by using:
    PHP Code:
    if(vidID == 3vidID 0// restart the count
    else vidID++; 
    and than playing videos[vidID] again
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

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