7 Replies Latest reply on Mar 22, 2007 6:57 AM by Newsgroup_User

    Automatic back to start of video

    Swarfega Level 1
      When a video I created has played its duration how do I get the video to go back to the start again ,but not play. I have created a play/ pause button that has the following actionscript:

      on (release){
      ns.pause("Cashel.flv");
      }

      What must I do to amend this actionscript?
        • 1. Re: Automatic back to start of video
          Devendran Level 1
          just use
          ns.pause() (i hope your "ns = NetStream")
          or
          ns.stop()
          • 2. Re: Automatic back to start of video
            Swarfega Level 1
            I did this and it made no difference, unless I misinterpreted ur reply:

            on (release){
            ns.pause("Cashel.flv");
            ns.stop("Cashel.flv");
            }
            • 3. Re: Automatic back to start of video
              Devendran Level 1
              Hi Don't pass any arguments inside these functions.

              my_ns.pause();
              //For first time it will pause if you use it second time it will play. if you wish to pass argument you have to pass a boolean value

              use this one to Rewind
              my_ns.seek(0)

              or use
              my_ns.close() to close the stream for more help you can refer flash help



              • 4. Automatic back to start of video
                Swarfega Level 1
                OK I did this:

                on (release){
                ns.pause();
                ns.seek(0);
                }

                I press play and it plays, but it doesn't pause - just goes back to the start and waits for me to press play again. But yes when it finishes I can press play and it plays. Help me with the problem!
                • 5. Re: Automatic back to start of video
                  Devendran Level 1
                  Hi
                  What you want to do?
                  When pressed Play It should play?
                  when pressed pasue it should pause?

                  or do you want to loop the video?
                  • 6. Automatic back to start of video
                    Swarfega Level 1
                    When I'm hoping top achieve is that I press play it will play and when I press it again it will pause. It's the one button. When the duation of the film is over, I want it to return to the start of the movie, so it will play for the beginning when I press play again.
                    • 7. Re: Automatic back to start of video
                      Level 7
                      Swarfega,

                      > When a video I created has played its duration how do I
                      > get the video to go back to the start again ,but not play.

                      It depends entirely on how the video has been presented in the Flash
                      Player. The FLVPlayback Component, for example, features a complete event
                      (this is listed under the VideoPlayer class's Event summary -- the
                      FLVPlayback class wraps a VideoPlayer instance).

                      (I hope I didn't sound tedious when asking for more information last
                      time, but this should help illustrate why good communication is important.
                      I can think of at least four completely different way to present an FLV to
                      the user, and each has its own unique class members [properties, methods,
                      and events].)

                      > I have created a play/ pause button that has the following
                      > actionscript:
                      >
                      > on (release){
                      > ns.pause("Cashel.flv");
                      > }

                      Aha. This gives us a hint that you're dealing with a different
                      approach, which means you're not using the FLVPlayback Component. The ns
                      variable suggests you're using NetStream.

                      As an aside, I see you're passing in the nave of your FLV to the pause()
                      method, but the NetStream.pause() method only accepts a Boolean
                      (true/false). Since you want this button to be a toggle -- which I remember
                      from your other post -- you shouldn't actually be putting *anything* between
                      the parentheses.

                      > What must I do to amend this actionscript?

                      Here's a tutorial on determining the end of a NetStream play.

                      http://www.wildform.com/support/tutorials/loopingFLVs/


                      David Stiller
                      Adobe Community Expert
                      Dev blog, http://www.quip.net/blog/
                      "Luck is the residue of good design."