5 Replies Latest reply on Aug 28, 2007 8:29 AM by Pop_Clingwrap

    FLVplayback plays audio only

    Pop_Clingwrap Level 1
      I have an instance of the FLV playback component on the stage called 'my_video' and an FLV called 'group.flv' stored in the same folder as the FLA (this is all running from my desktop). If I link the component to the FLV through the component inspector panel it works fine but when I try to do it with Acionscript I get the audio but no video and if I click the play/pause button I get this error:
      1000: Unable to make connection to server or to find FLV on server

      I am using this code:

      var connection_nc:NetConnection = new NetConnection();
      connection_nc.connect(null);
      var stream_ns:NetStream = new NetStream(connection_nc);
      my_video.attachVideo(stream_ns);

      stream_ns.play("group.flv");


      Can anyone tell me what I'm doing wrong here.
      Cheers all
        • 1. Re: FLVplayback plays audio only
          Level 7
          Pop Clingwrap,

          > I have an instance of the FLV playback component on
          > the stage called 'my_video' and an FLV called 'group.flv'
          > stored in the same folder as the FLA (this is all running
          > from my desktop).

          Okay.

          > I am using this code:
          >
          > var connection_nc:NetConnection = new NetConnection();
          > connection_nc.connect(null);
          // etc. ...

          Ah, that's code for a different approach altogether. If you're using
          the NetConnection and NetStream classes, you'll be leaving the FLVPlayback
          Component out of the equation. Instead, you'll use a Video object from your
          Library (right-click / Command-click in the Library and choose New Video,
          then drag that video asset to the Stage and give it an instance name
          (my_video, in this case) via the Property inspector.


          David Stiller
          Co-author, Foundation Flash CS3 for Designers
          http://tinyurl.com/2k29mj
          "Luck is the residue of good design."


          • 2. Re: FLVplayback plays audio only
            Level 7
            Pop Clingwrap,

            I should have added this: the FLVPlayback Component is fine to use, and
            if that's your choice, you don't need any ActionScript at all. Either
            select the component instance, click to the Parameters tab of the Property
            inspector, and put the path and name of your FLV file into the source
            parameter (in AS2, this would be contentPath) -- or, if you want to do it
            with code, give your component an instance name, then invoke the
            FLVPlayback.source (or contentPath, depending on language) property from a
            keyframe script:

            // AS3
            my_video.source = "myVideo.flv";

            // AS2
            my_video.contentPath = "myVideo.flv";

            With the component, that's all it takes.


            David Stiller
            Co-author, Foundation Flash CS3 for Designers
            http://tinyurl.com/2k29mj
            "Luck is the residue of good design."


            • 3. Re: FLVplayback plays audio only
              Pop_Clingwrap Level 1
              That is all good stuff, thanks a lot.
              I have to use cue points within the movie file to trigger events in the flash and also to load other flvs dynamically. If I use the FLVplayback can I set the content path dynamically and access the cue points that are embedded?

              cheers again, you have definitely pointed in the right direction
              • 4. Re: FLVplayback plays audio only
                Level 7
                Pop Clingwrap,

                > If I use the FLVplayback can I set the content path
                > dynamically ...

                Yes, that's the example I showed just before the end of my first reply.
                Use source for AS3 and contentPath if you're using AS2. It may help you to
                realize that components are nothing more than objects -- just like movie
                clips, text fields, and practically everything else. Objects are defined by
                something called classes, which describe an object's properties
                (characteristics), methods (things it can do), and events (things it can
                react to). Look in the ActionScript 2.0 or 3.0 Language Reference, as
                appropriate, and look up the FLVPlayback class, MovieClip class, TextField
                class, and so on, to see what your options are. In AS2, component classes
                are listed under the Components Language Reference. All of these are
                available under Help (or the F1 key).

                > ... and access the cue points that are embedded?

                You betcha.


                David Stiller
                Co-author, Foundation Flash CS3 for Designers
                http://tinyurl.com/2k29mj
                "Luck is the residue of good design."


                • 5. Re: FLVplayback plays audio only
                  Pop_Clingwrap Level 1
                  Excellent stuff. Think I know where I am going with this now. Thank you very much
                  :)