A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: dynamic external flv - multiple istances

  1. #1
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744

    dynamic external flv - multiple istances

    Hi Peeps.

    I'm having a bit of trouble here. I'm trying to create multiple video clips at once. I want to be able to attach x amount of video clips to the stage and load a different video into each one. It doesn't really bother me if they are streaming or not (they are very small clips) but streaming would be preferred. I would like the clips to loop.

    What i have been trying to do is...

    create a movie clip (with linkage id) with a video object clip inside it (made by selecting the 'new video' option from the library dropdown).

    Create a netconnection and netstream.

    attach the 'holder' clip to the stage several times and pass a different flv file name to each instance of the mc.

    It doesnt seem to be working atall

    I either get only one of the videos playing, or none of them playing and just sound.

    Can someone please advise me as to the best approach to tackle this?

    Any tuts and or resources would be appreciated

    thanks v much

    [m]

  2. #2
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    Okay.. have got it working to an extent... now using the same video object duplicated to play multiple videos (will make it dynamic with a loop... that part will be easy)

    Does anyone know how I can get the clips to loop? At the moment they play then stop.

    Thanks

    PHP Code:
    var my_video:Video// my_video is a Video object on the Stage
    var my_nc:NetConnection = new NetConnection();
    my_nc.connect(null);


    var 
    my_ns:NetStream = new NetStream(my_nc);
    v1.my_video.attachVideo(my_ns);
    my_ns.play("video44.flv");

    var 
    my_ns2:NetStream = new NetStream(my_nc);
    v2.my_video.attachVideo(my_ns2);
    my_ns2.play("02.flv");

    var 
    my_ns3:NetStream = new NetStream(my_nc);
    v3.my_video.attachVideo(my_ns3);
    my_ns3.play("3.flv"); 

  3. #3
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    Okay figured that out too

    PHP Code:
    var my_ns2:NetStream = new NetStream(my_nc);
    v2.my_video.attachVideo(my_ns2);
    my_ns2.play("02.flv");

    my_ns2.onStatus = function(info) {
        if (
    info.code == "NetStream.Play.Stop") {
            
    my_ns2.seek(0);
        }
    }; 
    Last problem... flv files in a sub directory?
    this doesent work as it does with jpgs and MovieClipLoader...
    PHP Code:
    "./files/video44.flv" 

  4. #4
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    hmm this seems to work... seems a bit like a hack though... anyone know why the above wont work?

    PHP Code:
    my_ns.play("../site/files/video44.flv"); 

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