3 Replies Latest reply on Sep 5, 2006 11:04 AM by fdarweesh

    Video.attachvideo versus MovieClip.attachMovie

    Brenda_Davis
      Quick summary: I have a number of flv files and an FCS to stream them from. All I'm trying to do is write some simple actionscript that loads whichever clip the user has selected.

      I'm brand new to using streaming media, and the distinction between the video object and movieclip object is breaking my mind. O_O I'm not using the FLVPlayer- the user's "navigation" all occurs outside the swf and is passed in via javascript. So now that I've placed a movie object on the stage, I have no idea whether it's appropriate to use something like

      var video_file = 'rtmp:// <insert passed url to clip here>';
      my_video.attachVideo(ns);
      ns.play(video_file);

      or attachMovie. Are they two ways to do much the same thing? Is attachMovie not intended to be used with streaming? Am I misunderstanding the distinction between the two entirely? Augh!
        • 1. Re: Video.attachvideo versus MovieClip.attachMovie
          fdarweesh Level 1
          yes they are not the and totaly different

          attachmovie is used to instantiate object from the library

          attachVideo used to attach Video to existing video stream over a connection

          and your case you have to use attachVideo


          regards

          Firas Darweesh
          • 2. Video.attachvideo versus MovieClip.attachMovie
            Brenda_Davis Level 1
            Thanks, I think I get it! Any idea why this doesn't seem to do anything, though? I have a movie object called my_video on the stage, and the following in the #included .as file:

            var nc:NetConnection = new NetConnection(); //create a connection
            nc.connect(null);
            var ns:NetStream = new NetStream(nc);
            ns.connect(); //connect the stream

            var video_file = 'rtmp://video/videosource/fish.flv';
            my_video.attachVideo(ns);
            ns.play(video_file);

            I'm defining video_file directly just to cut down potential points of error while I test, but when the swf loads, nothing happens. What am I missing?
            • 3. Re: Video.attachvideo versus MovieClip.attachMovie
              fdarweesh Level 1
              first remove ns.connect()

              second: try to load fish.flv from the same directory

              if this work....so you need to check the port ....wish rtmp protocol use

              check that port if open or closed





              var nc:NetConnection = new NetConnection(); //create a connection
              nc.connect(null);
              var ns:NetStream = new NetStream(nc);

              var video_file = 'fish.flv';
              my_video.attachVideo(ns);
              ns.play(video_file);