5 Replies Latest reply on Sep 18, 2007 9:18 AM by PKENGLISH

    FLV Volume problem

    PKENGLISH
      Hi, I am trying to load a FLV into a video object then detecting the end so i can gotoAndPlay the next frame. I am able to get all this to work but for some reason I cannot set the volume to mute. Here is the code I am using:

      myNetconnection = new NetConnection();
      myNetconnection.connect(null);
      myStream = new NetStream(myNetconnection);
      myStream.setBufferTime(1);
      COF_Large.attachVideo(myStream);
      myStream.play("COF_Large.flv");
      myStream.volume=0;

      myStream.onStatus = function(info)
      {
      //trace("info="+info.code);
      if (info.code == "NetStream.Play.Stop")
      {
      // Set flag, we will need to wait for
      // "NetStream.Buffer.Empty" Signaling the end.
      gotoAndStop(3);
      }
      }

      can anyone see what I am doing wrong? Thanks!
        • 1. Re: FLV Volume problem
          urbanrevolution
          try

          myStream.setVolume(0);

          good luck
          • 2. Re: FLV Volume problem
            Greg Dove Level 4
            I tend to use FLPlayback for most of my video stuff... but I had it in the back of my head that if you want to control the audio from a NetStream object you have to use Movieclip.attachAudio(NetStreamObj). In fact NetStream does not have a volume property. At least not in as2 I didn't check as3.

            Actually there's another step beyond that... creating a new Sound instance that references the audio in the MovieClip. Then you can control the volue with that Sound instance.

            Its all explained here:
            http://livedocs.adobe.com/flash/9.0/main/00001892.html#wp364316
            • 3. Re: FLV Volume problem
              PKENGLISH Level 1
              Thanks for that link... This is my first time playing a FLV through AS, I have always used the FLPlayback before this. Do you know if there is any advantage to either way? I figured i would try it this way since I hadn't before but if its all the same I might as well go back to using the FLV component.

              Overall this seems to be a bigger hassle. The main thing I was trying to avoid was the sandbox violation that comes with cross domains (but i see that i still have that problem doing it this way). I am trying to create an expandable video ad unit but the ad server rejects files with that security issue. Do you happen to know a work around for that?

              Thanks again.
              • 4. FLV Volume problem
                adobeuser999
                quote:

                Originally posted by: PKENGLISH
                ...This is my first time playing a FLV through AS, I have always used the FLPlayback before this. Do you know if there is any advantage to either way?
                .


                yep, the swf file size. SWF ads are supposed to be 30K or less & if you use the FLVPlayback component , you can't add too much more to your movie. Using AS to control FLV takes only less than 2K.
                • 5. Re: FLV Volume problem
                  PKENGLISH Level 1
                  Thanks a lot everyone! I was able to get it to work perfect (audio & video) as well as keep it under 28K by using AS to control the video.