4 Replies Latest reply on Oct 2, 2007 2:01 PM by Xero000

    FLVPlayback with cue Points (2.0)

    Xero000
      HI,

      I'm new to working with cuePoints and listeners. i using actionscript 2.0 and i want to make a video clip (called "video") to stop playing and become invisible after playing for 30 seconds. does anyone no a good cut and dry way to pull this off?

      thanks.
        • 1. Re: FLVPlayback with cue Points (2.0)
          Level 7
          Xero000,

          > i using actionscript 2.0 and i want to make a video clip (called
          > "video") to stop playing and become invisible after playing for
          > 30 seconds.

          You could use cue points for that, but you don't need to. If it's truly
          30 seconds you care about, consider using setInterval() or setTimeout() to
          stop the video and set its opacity to 0 or visibility to false after 30,000
          milliseconds.

          Assuming you're using the FLVPlayback component -- and that's what has
          the "video" instance instance name -- you could do this:

          setTimeout(function():Void {
          video.stop();
          video.visible = false;
          }, 30000);


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


          • 2. Re: FLVPlayback with cue Points (2.0)
            Xero000 Level 1
            great. that will certainly do the trick.

            any suggestions on making use out of the 'complete()' event?
            could i use that instead of having to hard code in the milliseconds?

            thanks!
            • 3. Re: FLVPlayback with cue Points (2.0)
              Level 7
              Xero000,

              > great. that will certainly do the trick.

              :)

              > any suggestions on making use out of the 'complete()' event?
              > could i use that instead of having to hard code in the milliseconds?

              Sure. The events all work the same for FLVPlayback, so once you get the
              process, you'll be good.

              var listener:Object = new Object();
              listener.complete = function(evt:Object):Void {
              video.stop();
              video.visible = false;
              };
              video.addEventListener("complete", listener);

              Still assuming an FLVPlayback instance name of "video," the above should
              do it. In AS2, there are at least four ways to handle events -- much more
              simplified in AS3 -- but the above shows how to do it for FLVPlayback.

              You need a generic Object instance, which you may as well call
              "listener," because it listens for the events. You'll assign a function to
              the complete event, which gets stored as a property of your listener object.
              The funtion, in this case, stops, the video and hides it.

              Finally, you subscribe the complete event, and that listner object, to
              the FLVPlayback instance.


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


              • 4. Re: FLVPlayback with cue Points (2.0)
                Xero000 Level 1
                hmm, i can't seem to get the listener working for this clip. I add trace statement so i know its getting through all the code.. but it doesn't seem to be detecting the end of clip.... i'll keep digging.